Re: Lat/Lon to Local Time
- From: kashe@xxxxxxxxx
- Date: Sat, 08 Jul 2006 15:48:57 -0700
On Mon, 3 Jul 2006 17:15:47 +0100, "Roger Mills"
<watt.tyler@xxxxxxxxxxxxxx> wrote:
In an earlier contribution to this discussion,
Anna <annalahoud@xxxxxxxxx> wrote:
Sam Wormley wrote:
Anna wrote:
I am writing a program that must calculate local time from
latitude/longitude. I realize this is not a trivial undertaking,
given the social and political issues of time zones. However, it
seems to me that there are programs I've seen that surely must know
the algorithm. Table based lookup is highly undesirable but will do
if there are no other solutions available.
Does anyone know how this is done?
In astronomy...
Longitude to local time
GMT ± (Longitude/15) = local time
I actually must go by political local times, not UT. So although I'd
love to write that ONE line of code, it's not what they have asked of
me. I am sure I am going to have to use a table for all the different
political boundaries. I guess I was just hoping that the solution was
small enough I could avoid it.
I can't see any way of avoiding lookup tables - because there are so many
anomalies relative to the simple 1 hour shift per 15 degrees. You almost
need to do it on a country by county basis - because parts of some countries
will be in an unnatural zone to keep them with the rest of the country.
Don't forget also that some areas shift their local time at certain times of
the year in order to achieve so called "daylight saving". This will, in
general, be the opposite way round in the two hemispheres at any given
longitude. Some areas near to the equator don't bother with daylight saving
time because their daylight hours don't vary much throughout the world. Just
one more spanner in the works - some parts of Australia use *half-hour* time
zones!
Not to mention Chatham Island at 12.75 hours and katmandu at
5.75 hours offsert. have fun building an algorithm to include those.
Oh - and don't forget the International Date Line - it doesn't
exactly run straight down the 180 deg longitude line!
.
- References:
- Lat/Lon to Local Time
- From: Anna
- Re: Lat/Lon to Local Time
- From: Sam Wormley
- Re: Lat/Lon to Local Time
- From: Anna
- Re: Lat/Lon to Local Time
- From: Roger Mills
- Lat/Lon to Local Time
- Prev by Date: Re: force a route in MapSource
- Next by Date: Re: Lat/Lon to Local Time
- Previous by thread: Re: Lat/Lon to Local Time
- Next by thread: Re: Lat/Lon to Local Time
- Index(es):
Relevant Pages
|