To track time (GMT standards) given lattitude & longitud

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dream2rule
Forum Contributor
Posts: 109
Joined: Wed Jun 13, 2007 5:07 am

To track time (GMT standards) given lattitude & longitud

Post by dream2rule »

Hello All,

I am a newbie in PHP and wanna know how to track the time (GMT standards) when lattitude and longitude locations are given.

It would be helpful if anyone could provide me with the code for the same!

Help Needed Urgently.

Regards
Last edited by dream2rule on Thu Jun 14, 2007 12:35 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You will need the time zone lines in latitude and longitude as well. After that, it's a bunch of comparisons.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

feyd wrote:You will need the time zone lines in latitude and longitude as well. After that, it's a bunch of comparisons.
I think it's even worse than that. Some time zones are irregular shapes and the only way I know to really determine the time zone from Lat/Long is to use GIS. Fortunately there is some GIS support in MySQL, but it will be a really messy operation. Take a look at http://dev.mysql.com/tech-resources/art ... mysql.html
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

califdon wrote:I think it's even worse than that. Some time zones are irregular shapes and the only way I know to really determine the time zone from Lat/Long is to use GIS. Fortunately there is some GIS support in MySQL, but it will be a really messy operation. Take a look at http://dev.mysql.com/tech-resources/art ... mysql.html
Right. I was actually referring to the irregular shapes in "it's a bunch of comparisons" .. although vaguely. ;)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

feyd wrote: .. although vaguely. ;)
Vagueness is always a good way to avoid being wrong. :P
suyeic
Forum Newbie
Posts: 6
Joined: Wed Jun 13, 2007 9:22 pm
Location: Bejing China

Post by suyeic »

I think you just need the value of longitude to decide which time zone you located, it's not a very complex work, I think.
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

GMT and GeoIP

Post by Gente »

There are some databases with GMT of some cities (about 500 and 1000).
Also you can find GeoIP tables with city, longitude. So you can find the closest city by latitude that presented in GMT table.
This way you cat find out GMT with a high probability.
dream2rule
Forum Contributor
Posts: 109
Joined: Wed Jun 13, 2007 5:07 am

Post by dream2rule »

Thanks for all ur replies.. i shall work on it and get back soon.. :D :D :D :D
Post Reply