I need a list of cities and the corresponding timezone for an autocomplete text input

StackOverflow https://stackoverflow.com/questions/600359

  •  03-07-2019
  •  | 
  •  

Question

Where can i find city/timezone data to populate my autocomplete text input.

The text input will be used to type in a city, then behind the scenes i will use the city to get the time zone...

I would prefer to hold it within the app itself and not get it in realtime.

This will be for an iphone app.

Thanks,

m

Was it helpful?

Solution

If you need this information for any city/town on earth, you'll need to use a webservice; there's no list of that as such. Look at this post for some recommendations: Web service - current time zone for a city?

I can't see the csv mentioned above, but, if you were after a time zone and a few relevant cities inside the zone, PHP has a DateTimeZone class

that will return all identifiers like this:

$data = DateTimeZone::listIdentifiers();

OTHER TIPS

if you download the windows mobile SDK in the resources folder is two csv files with city and timezone information. These files are free to redistribute.

http://msdn.microsoft.com/en-us/library/aa458853.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top