Difference between EST and America / New_York time zones

Can someone tell me what the difference is between the following two statements:

TimeZone.getTimeZone("America/New_York") 

and

 TimeZone.getTimeZone("EST") 

In other words, why is EST different from America / New _York. Also in my application, to get the current time zone in the USA, you should use America / New_York or EST.

+40
java timezone calendar
Mar 25 '12 at 20:13
source share
2 answers

EST is half the time zone in New York. It is always at standard time - it does not have a summer part. This is not a valid time zone; IMO is the “standard” part of a more complete time zone. When you write about a time zone that is a fixed offset and is not associated with a specific place, I would prefer to use "Etc / GMT + 5" or something similar explicitly fixed. (I don’t like even Eastern Time, etc., because different places that watch Eastern Time may differ in their daylight saving time. This is a bit like calling the encoding “extended ASCII” ... it says you about some information, but not quite enough.)

Therefore, if you want to find out the exact local time for New York at any given time, use America / New_York.

In general, stay away from abbreviations. From the documentation :

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

(Personally, I also advise you to stay away from Date and Calendar , preferring to use Joda Time where possible. Actually, this is a different matter.)

+52
Mar 25 '12 at 20:19
source share

EST - UTC - 5 hours. America / New _York - EST in winter and E * D * T in summer, so right now New York - UTC - 4 hours.

+83
Mar 25 '12 at 20:19
source share



All Articles