1. I have a Date object that represents the date and time in GMT. I need to be able to convert this into a date object that represents the equivalent EST time, Daylight savings need to be taken into account
2. I also need to convert a Date object representing the EST time into a Date object that represents the corresponding GMT time again taking into account Daylight savings.
I cannot rely on a constant difference between GMT and EST because daylight saving happens only in EST. I have tried out using the TimeZone, DateFormat and Calendar APIs, but I have not been successful.
Can someone help me with the code for doing this?
posted 9 years ago
A java.util.Datealways represents a time in UT/GMT (they're the same, to all practical purposes) internally. But a java.util.Date is not the way to exchange date/time information with a user or another system (unless it uses UT). Look at Calendar, TimeZone and DateFormat for that.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.