posted 14 years ago
What I am trying to do is create a Gregorian calendar and set the time to
one second before Daylight Saving Time begins, and print it out. Then I
want to reset the time to 2:00 am and see if it realizes it is now in EDT.
Okay... so here's my sample code:
The output looks like the following:
Current date/time = Sat Mar 07 20:59:59 EST 2009
Clearly this is EST, which is good, but it's -5 hours back
from the time I wanted to set. Of cours if I substitute the
following line for the calendar.set line above:
Then the output is:
Current date/time = Sun Mar 08 01:59:59 EST 2009
Of course I don't think I should have to do that.
I realize I am using the parent Calendar set()
method to do this, but shouldn't it use the same
TimeZone I set in the constructor? Do I have to
think in the GMT time, or is there a way to make
this set work as I imagined it?
Thanks,
DJ