Place Timezone information into a cookie with JavaScript

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.