0

I have a table which lists US cities and their timezone. The time zone is displayed as the commonly used AKST, AST, CST, EST, HAST, MST, or PST. I believe, but am not certain that these are referred to as Greenwich Mean Time format

As described by http://en.wikipedia.org/wiki/Tz_database, and described by http://www.w3.org/International/core/2005/09/timezone.html and used by Google Maps, there is a different name than the common EST, CST, and PST timezones.

The tz database, also called tzdata, the zoneinfo database or IANA Time Zone Database, is a collaborative compilation of information about the world's time zones, primarily intended for use with computer programs and operating systems.[2]

For instance, PST is the same as America/Los_Angeles. What is the tzdata names for the other AKST, AST, CST, EST, HAST, and MST?

user1032531
  • 24,767
  • 68
  • 217
  • 387
  • Are you *only* interested in American time zones? If not, there will be a bunch of ambiguities. Note that "EST" isn't really a time zone - it's the offset for half the year in a particular set of places. The actual time zone would include both EST and EDT, with rules for when places transition between them. – Jon Skeet Feb 06 '14 at 14:34
  • @JonSkeet US only. I want to change my list displaying EST, etc to the TZ format. – user1032531 Feb 06 '14 at 14:36
  • Okay. There will be potentially many TZDB time zone IDs mapping to a particular abbreviation. It's not *terribly* hard to get at them with something like Noda Time or Joda Time, to form a list... is that what you're after? (It's not clear what you expect an answer to this question to look like.) – Jon Skeet Feb 06 '14 at 14:39
  • 2
    @JonSkeet I haven't confirmed each of these, but am looking for something like AKST= America/Anchorage, AST=America/Halifax, CST= America/Chicago, EST= America/New_York, HAST= US/Hawaii, MST=America/Denver, or PST= America/Los_Angeles. An extra bonus explanation would be nice but not required. Thanks – user1032531 Feb 06 '14 at 14:44
  • My list of cities is really a list of zipcodes with cities, longitude, and latitude, and timezone (in EST format). Maybe using longitude and latitude, and not messing with the EST/CST/PST column is better? – user1032531 Feb 06 '14 at 14:52
  • Yes, I suspect so. You can get better results that way - look into http://www.geonames.org/ which will give you the time zone ID based on lat/long. – Jon Skeet Feb 06 '14 at 15:01
  • My list has 42,741 records (the number of US zip codes). Using just the timezone column would go fast, but checking each longitude and latitude will take a bit! Suppose I can automatic it. I've never worked with geonames before, but Google as an API for timezone given longitude and latitude. The limit is 2,500 queries a day I believe, so it will take 11 days. Better than me manually doing each record! – user1032531 Feb 06 '14 at 15:07
  • You can download the Geonames data too, although you'd then need to work out how to use it properly. You will lose data by *just* translating based on abbreviation - not everything with same abbreviation is actually in the same time zone. You should look into the Geonames API limits. – Jon Skeet Feb 06 '14 at 15:12
  • Thanks Jon. I originally thought this would very easy, but after searching for quite a while found nothing. Now I know why! – user1032531 Feb 06 '14 at 15:14
  • @user1032531 - Be aware that time zone abbreviations are often ambiguous and contradictory. EST has at least 2 completely different meanings, and CST has 5 ([see this list](http://en.wikipedia.org/wiki/Time_zone_abbreviations)). Also, is Hawaii HST or HAST? Is eastern Australia in EST or AEST? It just depends who you ask. There is no universal standard. Also, as Jon stated, they don't align to a timezone directly, but one or more of them might be used together as *part* of the definition of a timezone. – Matt Johnson-Pint Feb 06 '14 at 23:17
  • You may also be interested in [this post](http://stackoverflow.com/q/16086962/634824) about deriving time zones from lat/lon. – Matt Johnson-Pint Feb 06 '14 at 23:19

0 Answers0