Can somebody please tell, what's the difference 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 US, should I use America/New_York or EST.
EST is half of the New York time zone, effectively. It's always in standard time - it doesn't have the daylight saving part. It's not really a proper time zone in its own right, IMO - it's the "standard" part of a fuller time zone. When writing about a time zone which is just a fixed offset and not related to a particular place, I'd prefer to use "Etc/GMT+5" or something similarly obviously-fixed. (I don't generally like even "Eastern Time" and the like, as different places which observe "Eastern Time" may vary in their DST transitions. It's a bit like calling an encoding "extended ASCII"... it tells you some information, but not quite enough.)
So if you want to know the actual local time for New York at any particular instant, use America/New_York.
In general, stay away from the abbreviations. From the documentation:
(Personally I'd also advise you to stay away from
Date
andCalendar
, preferring to use Joda Time wherever possible. That's a different matter though, really.)EST is UTC - 5 hours. America/New_York is EST in the winter and E*D*T in the summer, so right now New York is UTC - 4 hours.