What's the quickest & easiest way to map lat/lng's to timezones, if you don't want to be relying on a web service to do this mapping?
Use my .java file or Swift file (CocoaPod) (thanks Andrew Kirmse) available here from github:
It's a database-in-a-single-source-file. There are changes to daylight savings times and so on many times a year, but the geographical boundaries of timezones hardly ever change. The most recent change is the Crimea peninsular. All the data for the polygons have been compressed and stored in source code so there's no database file you need. It's accurate to about 2km.
The provided code is available under the MIT licence.
If you need this in other languages then feel free to contribute to the open source project, by modifying the generator software. However I can't see this technique working with an interpreted language such as PHP.
I took shapefiles from here: http://efele.net/maps/tz/world/
I processed them into json according to a C library I found referenced in here:
Then I realised that 22km was still producing a lot of errors, because a lot of cities are within 22km of a timezone boundary, e.g. Gold Coast QLD, Chattanooga. Note - within 22km of a coast mostly works due to a custom rule I created, but still suspect there are some occasional errors there.
So I developed the '2km' version which uses a variety of techniques including polygons. But this is more effort to port to other languages.
If anyone wants the .json file of the polygons, which should be fully accurate if you can write code that makes sense of it, then email me on tim @ edval.com.au - the file is too big for Google Sites, 29Mb compressed. But it's dated late 2013, so doesn't have the change in Crimea.