Re: Need to use unix TZ timezone strings in java Timezone class
"Agarwal, Preeti (Med, GEMS-IT)" <Preeti.Agarwal@med.ge.com> writes:
java.util.TimeZone tz = java.util.TimeZone.getTimeZone("EST5EDT");
However this sets tz to GMT with 0 offset. How do I get the correct java timezone? Soemthing like "America/New_york" that I can use to get the current time in that timezone.
I don't know of any Java facility to do that. My previous message gave you a way of generating a table that maps strings like "EST5EDT" to strings like "America/New_York", by looking for "Link" lines in the tz database source files. You could generate this table by hand and drop it into your Java source code somewhere. The idea is that you modify your Java program to look up nonstandard strings like "EST5EDT" in your own table. For that particular example, you'd find an entry in your own table that says "America/New_York", and then use "America/New_York" instead.
participants (1)
-
Paul Eggert