programming-examples/js/Date/Write a JavaScript function to get Timezone..js

10 lines
264 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function seconds_with_leading_zeros(dt)
{
return /\((.*)\)/.exec(new Date().toString())[1];
}
dt = new Date();
console.log(seconds_with_leading_zeros(dt));
dt = new Date(1989, 10, 1);
console.log(seconds_with_leading_zeros(dt));