<p>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? </p>

<p>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.</p>

[{'answer_id': 55910, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 7, 'selected': True, 'text': '<p>earthtools.org provides a free web service to get the time zone from a city here:</p>\n\n<p><a href="http://www.earthtools.org/webservices.htm#timezone" rel="noreferrer">http://www.earthtools.org/webservices.htm#timezone</a></p>\n\n<p>You just pass in the long/lat values like this: (This is for New York)</p>\n\n<p><a href="http://www.earthtools.org/timezone-1.1/40.71417/-74.00639" rel="noreferrer">http://www.earthtools.org/timezone-1.1/40.71417/-74.00639</a></p>\n\n<hr>\n\n<p><strong>EDIT:</strong></p>\n\n<p>It seems like earthtools has been shut down. A good alternative (That did not exist in 2008 when this question was answered) is the Google Time Zone API. To use it you must first <a href="https://console.developers.google.com/flows/enableapi?apiid=timezone_backend&amp;keyType=SERVER_SIDE" rel="noreferrer">activate the Time Zone API</a> on your account. It is free if you stay below these limits:</p>\n\n<ul>\n<li>2500 requests per 24 hour period.</li>\n<li>5 requests per second.</li>\n</ul>\n\n<p><a href="https://developers.google.com/maps/documentation/timezone/intro" rel="noreferrer">The documentation</a> is available on Google Developers.</p>\n'}, {'answer_id': 55911, 'author': 'TheoJones', 'author_id': 5146, 'author_profile': 'https://Stackoverflow.com/users/5146', 'pm_score': 3, 'selected': False, 'text': '<p><a href="http://www.worldtimeserver.com/time_zone_guide/" rel="noreferrer">WorldTimeServer.com</a> 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.</p>\n\n<p>No connection, just had to research the same thing myself recently.</p>\n'}, {'answer_id': 55933, 'author': 'Eric', 'author_id': 5277, 'author_profile': 'https://Stackoverflow.com/users/5277', 'pm_score': 4, 'selected': False, 'text': '<p>Geonames.org has a wonderful set of worldly data that\'s available via webservice or download:</p>\n\n<p><a href="http://www.geonames.org/export/ws-overview.html" rel="noreferrer">http://www.geonames.org/export/ws-overview.html</a></p>\n\n<p>In particular</p>\n\n<p><a href="http://www.geonames.org/export/web-services.html#timezone" rel="noreferrer">http://www.geonames.org/export/web-services.html#timezone</a></p>\n\n<p>.</p>\n'}, {'answer_id': 8254354, 'author': 'megazoid', 'author_id': 638865, 'author_profile': 'https://Stackoverflow.com/users/638865', 'pm_score': 3, 'selected': False, 'text': '<p>Earthtool\'s timezone info is not up to date ... for an instance, the Sri Lankan current offset is +5.5 from GMT but EarthTools shows as +6 which was the old offset before 2005.</p>\n\n<p>I suggest <a href="http://GeoNames.org" rel="noreferrer">GeoNames.org</a>.</p>\n'}, {'answer_id': 14988400, 'author': 'Mike Davis', 'author_id': 641879, 'author_profile': 'https://Stackoverflow.com/users/641879', 'pm_score': 6, 'selected': False, 'text': '<p>We encountered same issue and, alongside the great suggestions above, Google appears to have two complementary APIs, one for Time Zone from geocode (latitude/longitude) data and the geocode API.</p>\n\n<p>For example, to get the time zone and offset for San Francisco:</p>\n\n<h3>1) Convert the city to a geocoded location:</h3>\n\n<p><a href="http://maps.googleapis.com/maps/api/geocode/json?address=San%20Francisco,%20CA&amp;sensor=false">http://maps.googleapis.com/maps/api/geocode/json?address=San%20Francisco,+CA&amp;sensor=false</a></p>\n\n<p>The geocoded location is in the JSON return data:</p>\n\n<pre><code>"location": {\n    "lat":  37.77492950,\n    "lng": -122.41941550\n}\n</code></pre>\n\n<h3>2)  Convert the geocoded location to a local timezone and offset, if any:</h3>\n\n<p><a href="https://maps.googleapis.com/maps/api/timezone/json?location=37.77492950,-122.41941550&amp;timestamp=1331161200&amp;sensor=false">https://maps.googleapis.com/maps/api/timezone/json?location=37.77492950,-122.41941550&amp;timestamp=1331161200&amp;sensor=false</a></p>\n\n<p>Which returns the current time zone information:</p>\n\n<pre><code>{\n          "status": "OK",\n       "dstOffset":  0.0,\n       "rawOffset": -28800.0,              \n      "timeZoneId": "America/Los_Angeles",\n    "timeZoneName": "Pacific Standard Time"\n}\n</code></pre>\n\n<p>Time zones for a region can change for a variety of reasons.  So it is a good idea to find an authoritative server-based solution and not cache. For more information see <a href="http://en.wikipedia.org/wiki/Time_zone#Programming_languages">Wikipedia\'s Time Zone article</a>.</p>\n'}, {'answer_id': 16241123, 'author': 'Karl Cassar', 'author_id': 571668, 'author_profile': 'https://Stackoverflow.com/users/571668', 'pm_score': 0, 'selected': False, 'text': '<p>I know this is answered, but I am posting this answer as people might still find it useful - The selected answer does not work successfuly right now.</p>\n\n<p>Google have their own service, which is very reliable and easy to use, and outputs info in JSON format.  It even allows for specifying a custom time, e.g get the timezone in 02/02/2013 in Malta.</p>\n\n<p><a href="https://developers.google.com/maps/documentation/timezone/" rel="nofollow">https://developers.google.com/maps/documentation/timezone/</a></p>\n'}, {'answer_id': 23994484, 'author': 'Shahid Aslam', 'author_id': 575904, 'author_profile': 'https://Stackoverflow.com/users/575904', 'pm_score': 2, 'selected': False, 'text': '<p>Simple Offline Library : <a href="https://github.com/Alterplay/APTimeZones" rel="nofollow">APTimeZones</a></p>\n\n<p>In order to find the time zone for a location you can use such as the Google Maps API’s time zone API. Unfortunately this requires you to query a remote service and you are subject to their limits.</p>\n\n<p>Here’s a library rom Alterplay called <a href="https://github.com/Alterplay/APTimeZones" rel="nofollow">APTimeZones</a>(Git is attached) that allows you to extract an NSTimeZone from a given location without the need to connect to a remote service.   <a href="https://github.com/Alterplay/APTimeZones" rel="nofollow">APTimeZones</a> works by querying a local listing of time zones (included with the library).</p>\n'}, {'answer_id': 41475938, 'author': 'Michael Nilsson', 'author_id': 1466802, 'author_profile': 'https://Stackoverflow.com/users/1466802', 'pm_score': 1, 'selected': False, 'text': '<p>In case anyone should bump into this question.</p>\n\n<ul>\n<li><p>You could use Google API to search for an address. That returns latitude / logitude. With those values in hand, you can find the closest timezone using e.g. PHP. </p></li>\n<li><p>Or you can use an API like timezoneapi.io (I\'m behind that) which enables you to search for an address / city / country. It returns the address, the timezone information and the current date/time for that given timezone.</p></li>\n</ul>\n\n<p><a href="https://timezoneapi.io/developers/address" rel="nofollow noreferrer">https://timezoneapi.io/developers/address</a></p>\n'}]
['https://Stackoverflow.com/questions/55901', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4808/']