Created
April 8, 2023 14:13
-
-
Save joekolade/2e0ff7e3f0fd3e20fbd3671f0bcc911e to your computer and use it in GitHub Desktop.
[Summertime detection JS]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param d date | |
| */ | |
| function isDST(d) { | |
| let jan = new Date(d.getFullYear(),0,1).getTimezoneOffset(); | |
| let jul = new Date(d.getFullYear(),6,1).getTimezoneOffset(); | |
| return Math.min(jan,jul) == d.getTimezoneOffset(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment