Dont know how I would get longitude and latitude of my users.
Also, not using HTML5 except for layout reasons. Liquid canvas.
So I am using HTML 4 transitional for structure.
Thanks for the response! I will at least look into your solution.
Couldn't hurt. :)
On Oct 20, 2012, at 7:35 AM, Samuel Lopes Grigolato wrote:
Have you tried Google Timezone API?
I don't know if it's free to use, probably not.
You may note that you need user's longitude/latitude to query this
solution is to query Google Places API
(https://developers.google.com/places/) based on the State name, or
HTML5 Geolocation API (http://www.w3schools.com/html/html5_geolocation.asp
I won't recommend as AFAIK it is not stable, others could correct me).
Hope it helps.
De: Maciek Sokolewicz [mailto:tula...@gmail.com] Em nome de Maciek
Enviada em: sábado, 20 de outubro de 2012 09:24
Para: Karl DeSaulniers
Assunto: [PHP] Re: User Timezone
On 20-10-2012 09:39, Karl DeSaulniers wrote:
Happy weekend. Hoping you can help me with an age old question.
I am trying to get a users timezone for a purchase online.
I know that php is not really able to get a timzone of a user because
its a server side execution with the date functions.
But I wanted to get a little help on my work around. I am hoping
someone can help. TIA
I have a form that a user must fill out in order to purchase
On this form they are required to put their city, state, country and
These are all required fields.
Now, I know there is a way to get a timezone offset if you have a
location to offset.
So is there a way based on the fields provided that I can get that
offset for each user?
(The users have to put a correct city, state, country and zip in
to get there purchase.
This address has to match their paypal or cc address in order to
purchase as well.
So I know there will still be a margin of error with user manipulated
info. So that is moot point for now.)
My thoughts are to get a timezone offset based on the country and zip
code, with a backup check of city state country zip.
I just don't know where to start looking for how to get the timezone
or UTC location based on country and zip or city state country zip.
so basically what you're looking for is a database map between
Did you try to google such a thing?
One of the first posts I found was a StackOverflow question about
of the answers mentioned just such a database on Tom Boutell's
same person who created the GD library [used for image-creation in
http://www.boutell.com/zipcodes/ It includes states, cities, zip
for the USA. Since you specifically mentioned you want to find it "by
state", it means you're mainly focussing on the USA (barely any other
country even bothers with states).
Apart from the above data, I'm sure you can find more on google.
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php