0

I have a list of cities state zip code. Is there a way in PHP where can pass some of those values and return the time zone id?

for example if I pass Nevada I get "America\Los_angels" in return.

Can this be done is PHP class? or I need to use external API like Google maps?

Thanks

Mike
  • 2,735
  • 11
  • 44
  • 68

1 Answers1

0

There is no such function in PHP. But you could do it yourself.

Take database of zip codes and states(Example: http://en.wikipedia.org/wiki/List_of_ZIP_code_prefixes), take database of timezones and states(Example: statoids.com/tus.html), combine it to new one.

Or.

You can use some webservice (Example: webservicex.net/uszip.asmx) for direct use or for build your own database.

sectus
  • 15,605
  • 5
  • 55
  • 97
  • webservicex.net/uszip.asmx does not return the PHP timezone. How can I combine the timezones and the states? for a timezones and state what you are referring to? http://www.php.net/manual/en/timezones.america.php? – Mike Jun 25 '13 at 00:39
  • @Mike , so, you need to build your own DB. It's not hard. – sectus Jun 25 '13 at 00:54