issue setting Calendar value via setTimeInMilliseconds
I am trying to create report start and end dates based on the current date. The following code produces the expected results:
Calendar endDate = Calendar.getInstance();
String cdate = DateTimeUtil.getStringFromDateWithoutT(endDate);
Calendar reportStartDate = Calendar.getInstance();
- (1000L * 60 * 60 * 24 * 7 * 13));
endDate is midnight of Sunday of the current week, and reportStartDate is midnight Sunday 13 weeks in the past.
(today is Aug 20,2013, endDate is Aug18, 2013 00:00:00, and reportStartDate is May 19, 2013 00:00:00)
When I try to generate a start date of 26 weeks in the past, by changing the '13' in the last statement above to '26', the resulting date is one hour earlier than expected (reportStartDate is Feb 16, 2013 23:00:00)
What am I missing?
NEVER MIND! Daylight Savings Time is the culprit.
Re: issue setting Calendar value via setTimeInMilliseconds
Never mind...Daylight Savings Time is the culprit.