• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EST instead of EDT

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I am currently using an application, and we did changes for effecting the DST(day light savings time). i am trying to get the time zones in my logs also, but what i found was, sometimes, i am getting EST and some times i am getting EDT. I am supposed to get EDT in all the places. In my java code i am using something like:
static
{
TimeZone.setDefault(TimeZone.getTimeZone(System.getProperty("SystemTimes.TimeZone","EST")));
}

I tried changing the EST to EDT, then i am getting GMT in my logs. What needs to be done to get EDT into my logs instead of EST.

Regards,
Sri.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you ran into the same problem discussed here. Why should anyone ask for EST and expect the result to be EDT? Yes, old Java versions fave this behavior because someone screwed up back in JDK 1.1, and it took this long to fix it. But three-letter timezone IDs have been deprecated since JDK 1.2. Try setting the time zone to America/New_York instead. If you still don't like the output format, you can use a SimpleDateFormat to change it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic