On Oct 21, 2012, at 5:11 PM, tamouse mailing lists wrote:
On Sun, Oct 21, 2012 at 7:30 AM, Matijn Woudt <tijn...@gmail.com>
On Sun, Oct 21, 2012 at 12:01 PM, Maciek Sokolewicz
On 21-10-2012 01:11, Karl DeSaulniers wrote:
Thanks for the response. Yes, for the US I plan on calculating by
this website is not geared to just the US.
So I am looking for a solution that lets me also calculate by
Was looking on google and found geoip, but not sure if this
I am looking for.
Anyone with experience on geoip that can send pointers?
Geo IP is based on IP, and I must warn you that IP data is not
accurate. Especially here in Europe, companies that are based in
multiple countries sometimes only register their IPs in a single
country, and share them between all the countries they are
This will give you wrong data from GeoIP. The time difference will
only be 1 hour at max, but still.
That was what my own suspicions were leading to.
I am familiar with the fact that ips can be spoofed.
Thanks for the corroboration.
As Bart said, IP is not ideal for this situation.
Since you do have information about the location of that person
country and possible state), you can find out the timezone via a
The HTML5 geolocation tool is nice, and would certainly help a
be aware of the fact that it only works if there is the device on
browser runs actually has the ability to find out its location. Many
smartphones have GPS chips, but most PCs don't. Asking a PC "where
located?" the PC will answer "How should I know?".
Luckily for you, the way of country and state is pretty easy. I've
you a list to find it in the USA. For most countries in the world,
simple 1:1 mapping of timezone and country
however 21 countries which have multiple timezones. In these
need extra information to be able to distinguish between them.
For the USA, you already have a way.
For (ex-)colonical islands and such (such as for France), you
add them to the country list:
- France (Marquesas Islands)
- France (Gambier)
Thus treating them as separate countries for your timezone db.
In Russia, Canada, Australia, New Zealand, Brasil, Indonesia,
Mexico,Congo, Ecuador, Micronesia, Kazakhstan and Mongolia you'll
know their province / state to more accurately assess the ideal
So for most countries, it's a simple 1:1 translation. For the above
countries, you'll need some extra info, and translate further
based on that.
You should be able to find the info required yourself, it just
takes a while
to collect it.
Alternatively, and this is the most simple way; since you're
for their country and such, simply also ask them about their
bother automating and putting a heck of a lot of time into hard to
solutions, when you can ask a very simple and easy-to-answer
question to the
browser instead. :)
Don't forget that some countries have DST, and some don't. And those
that have DST, all use different dates.. So in to keep a static
database you would also need to have DST info from all countries.
Using the standard labels in /usr/share/zoneinfo should be able to
avoid having to keep track of who is and isn't in DST, *provided* you
find a way to map the user's address to one of those files.
I am not familiar with this. Can you elaborate?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php