Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For my application I am searching for an API or an algorithm for clicking point time and time zone. I dont know how I can do this but after getting time I want to calculate giving coordinate sun rise/set time... I prefer python but javascript is okay.

I know EarthTools gives the information you need but I want to use it for local needs. In EarthTools I noticed that the given time is wrong, it is approximately one hour back...

Thank you in advance.

share|improve this question
The 1 hour difference could be because of daylight savings time. It is done country by country, and even state by state. – mhoran_psprep Mar 28 '12 at 12:40
up vote 3 down vote accepted

I have used this sun rise algorithm based on the one for the US Naval Observatory in the past. It does a good job of explaining the steps. Over the years I have used it in C, C++, VBA, Python...

share|improve this answer
is it only sun rise/set code and can i get current time when i click any location? – Aragon Mar 28 '12 at 13:44
do you have a shapefile (or some other file type) that has the time zone bounds? – mhoran_psprep Mar 28 '12 at 13:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.