10 lines
253 B
JavaScript
10 lines
253 B
JavaScript
function timezone_offset_in_seconds(dt)
|
|
{
|
|
return -dt.getTimezoneOffset() * 60;
|
|
}
|
|
|
|
dt = new Date();
|
|
console.log(timezone_offset_in_seconds(dt));
|
|
|
|
dt = new Date(1989, 10, 1);
|
|
console.log(timezone_offset_in_seconds(dt));
|