Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Timezone based on longitude and latitude

Status
Not open for further replies.

RicoCali

Programmer
Dec 7, 2002
80
US
Does anyone have a function that will give me Timezone based on Longitude and Latitude?
 
I can almost, 99.9999%, guarentee that the answer is no.

This is because there is no formula for it. You'd need a database with spacitial extensions to do this effectively.
 
Depends on what you mean by timezone, if you mean something basic then you can use the fact that every 15 degrees of longtitude = 1 hour in time difference. Eg Sydney is say 150W which equates to GMT + 10hrs, whereas 150E would be GMT-10hrs

Latitude does not affect the local time.
 
>every 15 degrees of longtitude = 1 hour in time difference

However, RicoCali, bear in mind that real-world timezones don't actually follow this rule; there are plenty of exceptions and quirks. This is why SemperFi mentioned a database.

The maps shown on or illustrate this quite nicely
 
I live in Adelaide. We are +9.5 GMT, Factor in what locations have or do not have Day light saving it can become really hairy. There are 4 other time zones in the world that are offset by 1/2 hour.

 
... and there are some which are offset by only 15 Min. Further, the "lines" do not (Always) go due north -South (the shifts in the partial increments are not East-West, but go along some 'diagional' line). I'm not sure that MOST of that matters for casual purposes, but if you are interested in 'Accuracy', it makes even a table insufficient, at least by itself.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
MapInfo have a product that stores the necessary information in a database that can be queried: Time Zones and Daylight Saving Time
 
Saudi Arabia officially uses "Solar Time", so in effect, an infinite number of timezones!

Just don't get me started on daylight savings time. One of my customers is in Indiana, and they don't change over at the same time as the rest of the USA. Truly difficult to set up conference calls with them. ;-)

Found the link to the MapInfo product:

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
chiph

> Saudi Arabia officially uses "Solar Time", so in effect, an infinite number of timezones!

Really? I lived there for 9 years and I never knew that ... though I have no doubt that it's true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top