Ben Godfrey

Capturing time zone with JavaScript

Facebook detects a user’s timezone through JavaScript. A Date object is created, the timezone offset and sent back to the server via an Ajax request. This is done on every home page view, so at least every login and generally much more often. It’s a simple technique and reliable, because it uses the value set by the visitor on their current computer, dates and times are consistent with the system clock in the corner.

Bookmark and Share

Comments

Add a new comment

Your avatar

Add a new comment

Cancel   Forgot password?
Cancel

Attention! Log in (if you've commented before) or use your OpenID.

You can use Markdown here.

Preview