View Single Post
  #1 (permalink)  
Old 05-08-2008, 10:24 AM
prachi_goliwadekar prachi_goliwadekar is offline
Member
 
Join Date: Apr 2008
Posts: 3
prachi_goliwadekar is on a distinguished road
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
Reply With Quote
Sponsored Links