Home > Web Front-end > JS Tutorial > Use js to determine whether the current time zone TimeZone is daylight saving time_javascript skills

Use js to determine whether the current time zone TimeZone is daylight saving time_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:58:27
Original
1832 people have browsed it
Copy code The code is as follows:

var d1 = new Date(2009, 0, 1);
var d2 = new Date(2009, 6, 1);
if (d1.getTimezoneOffset() != d2.getTimezoneOffset())
{
alert('Daylight Saving Time'); // Daylight Saving Time
}
else
{
alert('Daylight Time'); //Non-Daylight Saving Time
}
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template