Просмотр файла sistem/clock.js

Размер файла: 594B
function padZero(n) {
n = "00" + n;
return n.substring(n.length - 2);
}
var dateObj = new Date();
var m = dateObj.getMinutes(), h = dateObj.getHours() + dateObj.getTimezoneOffset() / 60;
function daylightSaving() {
var now = new Date(),
nowTZ = now.getTimezoneOffset(),
winterTZ = new Date(now.getFullYear(), 1, 1).getTimezoneOffset(),
summerTZ = new Date(now.getFullYear(), 7, 1).getTimezoneOffset();
return (winterTZ !== summerTZ) && (nowTZ === summerTZ) ? 1 : 0;
}
var recovery = daylightSaving();
document.write(' '+padZero((24 + h + 3 + recovery) % 24) + ":" + padZero(m));