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.