- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
function getUserLocalTime() {
var date = new Date(), h = date.getHours(), m = date.getMinutes(), offset = date.getTimezoneOffset();
offset = -offset / 60;
if (offset < 10) {
offset = '0' + Math.abs(offset);
}
offset = (sign(offset) ? '+' : '-') + offset;
if (m < 10) {
m = '0' + m;
}
return offset;
}
function sign(x) {
x = +x;
if (x === 0 || isNaN(x))
return x
return x > 0 ? 1 : -1
}
3.14159265 27.08.2015 13:53 # 0