Re: timezone algorithm
From: Wannabee (no_at_mail.thanks)
Date: 03/04/05
- Next message: vel: "security exception applet mysql please help!"
- Previous message: Daniel Tryba: "Re: help with java code --new to programming"
- In reply to: Rikard: "timezone algorithm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 4 Mar 2005 08:47:52 +0200
"Rikard"
> Hi
>
> Looking for a function that returns the timezone for any given point.
> I want to feed it with longitude and latitude.
>
> any ideas?
If you are a navigator on _sea_, the timezone (in hours) is simply longitude
(in degrees) divided through 15. Round the result to the nearest integer.
Positive for west longitudes and negative for east longitudes. Latitude
doesn't matter. What you got is a zone constant which added to ZT (zone
time) gives UT.
If you mean timezones on _land_, that is much more complicated. It would be
a little easier to talk about _countries_ rather than latitudes and
longitudes. Some countries have many different timezones. Different
countries may have a different timezone on the same longitude. The timezone
is not allways an integral number of hours. There is also often "daylight
saving time" / "summer time" used. The dates when the change "normal time" -
"summer time" is made in different countries are not very simple and clear.
That means latitude and longitude alone cannot tell the timezone for the
whole year. In addition to latitude and longitude you would also need the
date and time (and maybe even the year).
It may be quite hard to make this valid everywhere and perfect. If you are
satisfied with a partial and/or approximate solution, it might be easier.
Ignore "summer time"? If you really want lat & long as the arguments, you
need to know what are borders of timezones in different countries and inside
which borders does the particular point (lat & long) fall ... seems like a
lot of work?
- Next message: vel: "security exception applet mysql please help!"
- Previous message: Daniel Tryba: "Re: help with java code --new to programming"
- In reply to: Rikard: "timezone algorithm"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|