Alex Rivera | Logout

How to get client's timezone?

Asked 2009-12-15T05:44:04.063
35

I'm writting an application using Zend_Framework (so the solution can rely on it).

How to get client's timezone?

For example, if someone in Moscow, Russia, I want to get 3*60*60 (because there is UTC+3). If he is in UK, I want zero. If he uses UTC-3:30 (Canada?), I want -3.5*60*60.

(it's not a question about a format - I'm ok with getting 'Europe/Moscow' or 'UTC-3' for St. Petersburg, Russia, it's rather about getting timezone client uses. But delta in seconds is preferred)

The only solution which comes to mind is letting javascript get the local time for me and redirect.

Edit
Report

1 Answer

1

I think your best bet is to guess based on the Accept-Language header sent over by the client.

answered 2009-12-15T05:51:42.540

Your Answer