|
Creating a Gregorian Calendar using a Date object gives date - 1
I have a Date object
Date dt = rs.getDate("passwordExpiryDate"); // This returns me date as 10 May 2008
now I want to check if today is my password expiry date -
TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT-0");
Calendar calendarExp =new GregorianCalendar(TIME_ZONE); // This gives me todays date i.e. 8 May 2008
calendarExp.setTime(dt);
When I set dt to the calendar it changes the date to 7 May 2008.
Can any onw pls help me..
Thanks,
Prachi
|