posted 15 years ago
I need to get times, adjusted to a user-specified time zone. I.e., when I create a new GregorianDate, I want it to reflect the current time, adjusted for that time zone.
For example, assume the system clock is on central time, and it's noon in the central time zone. If the user specifies that they are in the eastern time zone, I want a new GregorianCalendar object set to 1:00 pm, not noon. (The system time is out of my control.)
I read the GregorianCalendar documentation, and I thought it would be a matter of passing in a TimeZone to its constructor, but that seems to have no effect.
In this example, I just ran it and the console shows:
So passing those TimeZone object to the GregorianCalendar constructor doesn't seem to do anything.
Help! And thanks!