tryin_to_learn — 2013-01-07T09:26:37-05:00 — #1
This isn't specifically a PHP question but since that's what our app is using, I thought I'd start here. The application we're developing requires time stamps on certain things and they need to be based on the user's actual time. Obviously we can collect time zone info when they register but are there some behind the scenes way to get the information from the zip code they give us? Preferably something free.
kylewolfe — 2013-01-07T09:34:53-05:00 — #2
starlion — 2013-01-07T10:00:51-05:00 — #3
Were it me, i'd use a database (GeoNames puts out a TSV file for the US: http://www.geonames.org/export/zip/US.zip ) to translate Zip to State, and then map State to time zone (geoip_time_zone_by_country_and_region)
tryin_to_learn — 2013-01-07T21:29:05-05:00 — #4
kgh — 2013-01-07T21:45:51-05:00 — #5
tryin_to_learn — 2013-01-07T21:50:38-05:00 — #6
Wouldn't this have to assume that the user has their clock set correctly?
starlion — 2013-01-08T08:00:16-05:00 — #7
and that the user never went on a business trip or vacation....
tryin_to_learn — 2013-01-08T09:26:01-05:00 — #8
kylewolfe — 2013-01-08T09:59:29-05:00 — #9
This is why you use geoIp to get their starting location (if you want) but allow them to enter their own zip if they see that it is incorrect, you can still use geoIp to obtain info based on that rather than IP