Skip to content

Instantly share code, notes, and snippets.

@pemheath
pemheath / zoned.js
Created January 18, 2023 19:11 — forked from defunkt/zoned.js
Timezones in JavaScript, from http://errtheblog.com/posts/49-a-zoned-defense
var Timezone = {
set : function() {
var date = new Date();
date.setTime(date.getTime() + (1000*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = "timezone=" + (-date.getTimezoneOffset() * 60) + expires + "; path=/";
}
}