1

I have researching the solution on Stackoverflow, but don't see anything for my specify question. So I need your help.

  • I have Areacode (201) and I can determine Offset and Timezone description (-5, Northern New Jersey). link: http://greatdata.com/areacodetimezone
  • But now, with AreaCode (201), I want to determine Timezone id ("America/Bogota")

I have a big problem. With offset -5, there are so many return results. I can't see any solution for mapping. Can anyone help me?

  • 1
    `America/Bogota` is the time zone id for [Bogota, Colombia (South America)](https://en.wikipedia.org/wiki/Bogot%C3%A1), not [Bogota, New Jersey, USA](https://en.wikipedia.org/wiki/Bogota,_New_Jersey). All of New Jersey is in the US Eastern time zone, which is `America/New_York` in the tzdb. Also, keep in mind that area codes are not very reliable as a source of location these days, as people travel/move with their cell phones, and due to [number portability](https://en.wikipedia.org/wiki/Local_number_portability). – Matt Johnson-Pint Jul 31 '17 at 16:48
  • 1
    Also, there are many area codes that cover more than one time zone, such as 605 for South Dakota - half of which is in Mountain Time and half is in Central Time. – Matt Johnson-Pint Jul 31 '17 at 16:51
  • Hi Matt Johnson, I understand your comments, because my project is using Areacode, so i need follow, I have one more question. If i have Areacode = 202 and offset = -5, and timezone description = "Washington, D.C.", how can i determine Zone id. There are no zone id in getAvailableZoneIds() method. – Nguyen Viet Quan Aug 01 '17 at 01:18
  • You're missing the point. Accurately determining the time zone from an area code is not possible. There are too many edge cases. You should look for some other source to derive it from, such as latitude/longitude. – Matt Johnson-Pint Aug 01 '17 at 01:56
  • Hi Matt Johnson, you're right again. My task will map between from Timezone description to Zone ID, EX: I have timezone description ("Idaho"), then I can determine Zone ID = "America/Boise", but when timezone description is "Washington, D.C.", I can not get something as "America/...." in getAvailableZoneIds() method. can you have any ideals ? – Nguyen Viet Quan Aug 01 '17 at 03:21
  • Where does your "timezone description" data come from? If it's just any city in the world, then that's not going to work. Each time zone is represented by a single city, usually the most populous in the region. The list of valid time zone ids is [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). – Matt Johnson-Pint Aug 01 '17 at 17:44
  • If you are getting your data from an address, you can try a Geocoding API, such as [this one from Google](https://developers.google.com/maps/documentation/geocoding), which will give you a lat/lon. Then you can [determine the time zone from that](https://stackoverflow.com/questions/16086962/how-to-get-a-time-zone-from-a-location-using-latitude-and-longitude-coordinates). – Matt Johnson-Pint Aug 01 '17 at 17:45
  • I used timezone description at "region" column in http://greatdata.com/areacodetimezone, from that i know Zone id in "Std Time Zone" column (ex: "EST" from Jersey City, but I want something like "America/jersey", but not have). I will think more about your recommendation by using Geocoding API, by the way,I thank you so much. – Nguyen Viet Quan Aug 02 '17 at 02:00
  • That list is suspicious to me. Even so, look at how many entries are marked with an `*` with special conditions. Also, it doesn't tell you important things like how it shows all of the Arizona time zones as MST, but doesn't tell you that most of Arizona doesn't due daylight saving time. In the TZDB, there is a significant difference between `America/Phoenix` (MST only) and `America/Denver` (MST/MDT). – Matt Johnson-Pint Aug 02 '17 at 16:44
  • Yes, not enough info for getting ZoneId from timezone description, so I will do convert from -5 for EST, -6 for CST..etc.. Thanks you for supporting. – Nguyen Viet Quan Aug 03 '17 at 10:31

0 Answers0