This JavaScript will pick up the users timezone offset and place it nto a cookie. This is useful for when you want to diaply times in your web application taking the users location into account.
As the timezone is placed in a cookie it can be extracted by any serverside scripting technology. Javascript returns the timezone information in minutes so the script converts it into hours.
// By default, getTimezoneOffset returns
// the time zone offset in minutes
setCookie("timezone", new Date().getTimezoneOffset()/60);
function setCookie(name, value, expires, path, domain, secure)
{
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" +
expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}

Sachin Gedam
Its really a useful way to get timezone information.. but there is a problem with this solution…there are many time zones which shares same GMTOffset, so how can identify exact time zone on server side based on GMTOffSet.
For example:
Beijing
Perth
Taipei
Kula Lumpur
these time zone sharing same GMT Offset (+8:00), so when i receive GMTOffset than at server side i may not be able to get exact time zone.
Link | August 3rd, 2006 at 6:55 am