views:

3848

answers:

4

Is there a web service of some sort (or any other way) to pull a current time zone settings for a (US) city. For the parts of the country that don't follow the Daylight Saving Time and basically jump timezones when everyone else is switching summer/winter time... I don't fancy creating own database of the places that don't follow DST. Is there a way to pull this data on demand?

Thank you!

EDIT: I need this for the database server (not for client workstations) - there entities stored in the database that have City, State as properties. I need know current timezone for these entities at any moment of time.

EDIT2: Thank you for the great answers!

EDIT3: Sorry SO only allows 1 post marked as "answer", @Espo posted good answer too.

A: 

Operating systems usually have that information locally. What OS are you developing for?

(Ten years ago I wrote some VB6 that queried Windows...)

Stu Thompson
+9  A: 

earthtools.org provides a free web service to get the time zone from a city here:

http://www.earthtools.org/webservices.htm#timezone

You just pass in the long/lat values like this: (This is for New York)

http://www.earthtools.org/timezone-1.1/40.71417/-74.00639

Espo
+2  A: 

WorldTimeServer.com has what appears to be a comprehensive time zone database, which you can purchase access to in a variety of formats, including a .NET component for Web use.

No connection, just had to research the same thing myself recently.

TheoJones
+4  A: 

Geonames.org has a wonderful set of worldly data that's available via webservice or download:

http://www.geonames.org/export/ws-overview.html

Eric Willis