4 ms·
I completely agree - but as you point out, JavaScript doesn't use proper UTC but a simplified version that does not account for leap seconds. Let's call it Date
by VMG 14y ago
I completely agree - but as you point out, JavaScript doesn't use proper UTC but a simplified version that does not account for leap seconds. Let's call it Date.UTC.
In Date.UTC, there are no leap seconds and therefore the Day == 862e5 assumption holds and we can use it to calculate the difference between two dates measured in days, which is the point of the blog post.
When doing arithmetic with real UTC, you are absolutely correct and we have to take leap seconds into account.