Rate this script:  I Love it  /   I Hate it

Place Timezone information into a cookie


Code


//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" : "");
}
 

 

 
Place Timezone information into a cookie scripts | Place Timezone information into a cookie snippet | Place Timezone information into a cookie example | Place Timezone information into a cookie tutorial | Place Timezone information into a cookie code