I\'m trying to convert a long timestamp that is UTC to Eastern Standard Time and am totally lost. Any hints would be great!
Time format should be : 11/4/03 8:14 PM
Timezone conversion can be tricky. You should probably use Joda Time where timezone tables are constantly updated (and can be updated manually if needed
Using Joda time it is pretty easy:
public static Date convertJodaTimezone(LocalDateTime date, String localTimeZone, String destTimeZone) {
DateTime srcDateTime = date.toDateTime(DateTimeZone.forID(localTimeZone));
DateTime dstDateTime = srcDateTime.withZone(DateTimeZone.forID(destTimeZone));
return dstDateTime.toLocalDateTime().toDateTime().toDate();
}
with timezones from the following table