I'm in the midst of programming a mobile site that should deal with different timezones. Is there a function that gets the timezone off the mobile device? I'm php Zend Framework based.
3 Answers
AFAIK the procedure for getting the timezone from a mobile device is the same as getting it from a desktop client. The mobile browser must support JavaScript or you have to ask for the user to choose and submit their timezone. See this question: How to get client's timezone?
-
Also see "Get client timezone (not GMT offset amount) in JS" http://stackoverflow.com/questions/2897478/get-client-timezone-not-gmt-offset-amount-in-js – Doug Domeny Feb 17 '12 at 16:18
Precisely because the device is mobile, there is no point in determining the timezone on the server side. Instead, use client-site time.

- 278,196
- 72
- 453
- 469
There's no direct way to do this. You can estimate the user's time zone based on his IP address (geolocationing stuff), but that's not really accurate.
Just have a look at most forum scripts how they do it. In general they'll use a small JavaScript to compare server time(zone) and browser time(zone) - but there's no general API or HTTP header field for this.

- 35,726
- 5
- 62
- 78