- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
function timeOffset() {
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = jan1.toGMTString();
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ") - 1));
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
var abc = '';
if (std_time_offset > 0)abc = '+';
if (std_time_offset < 0)abc = '-';
std_time_offset = Math.abs(std_time_offset);
if (std_time_offset < 10) {
std_time_offset = std_time_offset.toString();
std_time_offset = '0' + std_time_offset;
}
std_time_offset = abc + std_time_offset;
return std_time_offset;
}