• 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

Rich Faces always show GMT as TimeZone

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Above code is always showing date as "31-Oct-2014 10:28:57 AM GMT". I want to display this in "31-Oct-2014 10:28:57 AM EDT". Please help to know the solution.
 
Saloon Keeper
Posts: 27865
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


For compatibility with JDK 1.1.x, some other three-letter time zone IDs (such as "PST", "CTT", "AST") are also supported. However, their use is deprecated because the same abbreviation is often used for multiple time zones (for example, "CST" could be U.S. "Central Standard Time" and "China Standard Time"), and the Java platform can then only recognize one of them.



Incidentally, when they say "other three-letter time zone IDs" they mean that the 3-letter IDs "UTC" and "GMT" are always valid, not deprecated.

The preferred zone ID for Eastern time (which just exited Daylight Savings in the USA) would be something like "America/New_York". You can get a complete enumeration of the valid values from the API - the documentation is in there somewhere, although I don't remember exactly where.

The important thing is that JSF didn't re-invent time zones, so it's using the same options as http://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html

Where your main point of failure was was in specifying EDT - Eastern Daylight Time. EST might have worked. But one of the other reasons why the 3-letter codes are deprecated is that "EST" would presumably actually return an EDT value when USA Daylight Savings was in effect, which is confusing. And different countries within a timezone go on/off Daylight/Summer time on different dates. Which is why the Continent/City notation is preferable. It allows picking the most appropriate locale for both zone and daylight shift.
reply
    Bookmark Topic Watch Topic
  • New Topic