Is there a database of time zone lines available for download? - geolocation

I've searched and found a couple of online web services that do this, but I was wondering it there's a database in the public domain which gives a list of latitudes and longitudes for the standard time zone lines? I'd like to be able to calculate what time zone a coordinate is without using a web service. I figured that time zone boundaries are mostly static and were probably decided by some committee, so there should be a CSV or GPX or KML somewhere.
I'd like to be able to check what time zone a coordinate lies in, for example:
48.856667 2.350833 is GMT+1 or CET

This is a series of files -- timezone polygons (shapefile), which you can transform into boundaries. With work on your part.
http://efele.net/maps/tz/world/
You should note that simply knowing the TZ does not guarantee that you know anything about the current correct time or date there in terms of the local calendar. Time Ex: The Isreali Knesset (parliament) decides when Daylight time starts and ends - sometimes they have chosen a date in the past. Date Ex: The Hijri Calendar changes months based on the ability of people in Mecca to actually observe the new moon from there. Cloudy days alter the date.

Askgeo.com has a Java library under commercial license. (Scroll down their page to find information about it). They charge 2 grand up front for it though, considering the amount of work they must have put in compiling loads of vector maps, etc, I can understand they want the money.
I use their free API, but you wanted something downloadable, and I think this is one of your few bets.

I tried openstreetmap and they have the data, but it would be buried in a map of Earth, not completely useful itself. Here is one on Wikipedia though: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

I recently found this data here:
https://github.com/straup/whereonearth-timezone

Related

is iphone timezones reliable? Alternatives?

I am currently writing an app that needs to represent some data arranged by local time. Since I don't think relying on [NSDate date] is a good idea at all, because the user can change his time wrongly, hence messing up my data. I then thought it would be better to make a timestamp (server time) and then represent the data comparing the difference between my timestamp timezone and users timezone. Am I right doing it this way?
Obviously this needs pretty much full reliance on timezones given by iOS are correct. If no, are there any better alternatives (like google timezone api?) (I would think they are both based on tz_database though?)
Thanks for any input

Is AddThisEvent's timezone (zonecode) arbitrary?

I have users stored in the database and need to save a timezone to associate with the user so that I can use it to create events with AddThisEvent and to display other localized times.
Is the mapping from a timezone offset to the AddThisEvent zonecode arbitrary- or is he using some standard that I couldn't find?
The documentation in Step 2 describes the list of available values for the _zonecode.
These appear to be Microsoft Windows time zones, as mentioned in the timezone tag wiki.
However, the actual integers assigned to each "Zonecode" appear to be proprietary to AddThisEvent. It's likely that they are using TimeZoneInfo.GetSystemTimeZones in .NET, and assigning each entry to an integer.
Hopefully, they realize that this list is not necessarily fixed. Microsoft can provide updates which add entries to Windows when new time zones need to be created. For example, two new time zones are being added soon for the upcoming October 2014 Russian time zone changes. These would be added in the middle of the list, so the list would no longer be sequential. If they are just using an index value of the array returned, they'll be surprised when the changes cause everything to shift forward.
(Note - I have no special knowledge of how AddThisEvent is actually planning to handle updates. I am just speculating.)
In general - integers are not good time zone identifiers.
So what should I do then?
Map each of the proprietary entries back to the Windows time zone they belong to. Then, if necessary, map them to the standard IANA TZ identifier used by PHP, Python, Java, etc. You can use the CLDR mappings to determine an appropriate TZ identifier to use for each Windows time zone.
It's a shame you'll have to jump through so many hoops, but in the end, you'll be able to figure out the appropriate integer to use with AddThisEvent for each user.
It looks like AddThisEvent has already updated their timezone handling. However, if people are still using the older library and are running into this problem, one solution is to convert the datetime to UTC before passing it to AddThisEvent. Then you can use the _zonecode 35 (UTC). Calendar options like Google, Outlook, etc should be able to convert from UTC to the user's timezone appropriately.

Creating momentjs timezone map, no output

I'm new to html, css and js. Thus far I've managed to create a website via trial and error and research to learn the craft but I cannot find an answer to my (assumingly) basic momentjs problem.
I'm trying to create a map based on the momentjs timezone map.
I have the moment.js file from cdnjs, the moment-timezone-js from http://momentjs.com/downloads/moment-timezone.js and the moment-timezone-data.js built from http://momentjs.com/timezone/data/
But I have a hunch I've put stuff in the wrong place in the html. I've google'd for a way out but have not found anything thus far.
Thank you,
Kristian
moment-timezone is about converting date and time values to a particular time zone, not about mapping. The map shown on that website is not an example of using moment-timezone to draw the map, but rather it uses other data and techniques to draw the map, then uses moment-timezone to convert the current time to the time in that zone.
If it's mapping you want to explore, take a look at this map-based time zone selection control.

glibc to uclibc Timezone mapping file

I came across a mapping file for timezone strings from glibc to uclibc. It looks like this:
Africa/Abidjan=GMT0
Africa/Accra=GMT0
Africa/Addis Ababa=EAT-3
Africa/Algiers=CET-1
...
This file is quite old (4 years), and several new TimeZones have been added on glibc. However, I could not find the latest mapping file. The mapping file has 451 entries, where as the total timezone strings supported these days is over 900. Is there an updated mapping file for the same?
From the data you provided, the left side appears to be an IANA/Olson time zone identifier. You can see a rough list of these zones and their offsets on Wikipedia.
The right side appears to be a time zone abbreviation and the standard offset for the zone, with its sign inverted. This might be a POSIX style time zone string. I can't tell since you only provided a small sampling.
You can read more about both of these in the timezone tag wiki. Be sure to read about the limitations of POSIX time zones.
Some searching found this thread where they discuss that uclibc only supports POSIX time zones. If you're using buildroot, you could see if the "tzdata" package will work for you, but I'm not sure if it will or not. If it does, you would use it the same way that glibc does, with the TZ variable setting (see the last option at the bottom of the page).
As far as mapping IANA to POSIX zones - any list you have is going to be limited to the current time zone rules, and then still won't cover necessarily everything. Only the IANA zones are comprehensive. It would also be a one-way mapping. You could not go the other direction. I searched, but did not find a direct source for this mapping. If you find one, please let me know.

How to calculate tides for specific date and location with Delphi

Just saw this question in Stack How to calculate sunrise and sunset time for current date with Delphi
Is there any way to calculate tides ? for a date and location.
Thanks
No. Sunrise and sunset is based on the simple fact that the earth is (almost) a sphere that is lit by the sun.
Tides are also based on the geographic properties on the land.
For instance the island of Great Brittain influences the tides along the Dutch and Belgian coasts because the water takes time to flow though the street of Calais.
That is why the local government publishes tides tables for most regions of the world.
See also http://www.ehow.com/how_7705476_calculate-ocean-tides.html
I don't know of any existing solutions in Delphi, but it's certainly possible.
WxTide32 is the most well known free tide program.
A good place to do some research would be
http://www.wxtide32.com/links.html

Resources