-
Notifications
You must be signed in to change notification settings - Fork 821
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a timezone guide for DST jumps at midnight
- Loading branch information
1 parent
67497bd
commit 1fbca2d
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
guides/moment-timezone/01-data-calculations/03-dst-jumps.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Timing of DST Jumps | ||
--- | ||
|
||
Time zones that use daylight saving time (DST) vary about when they implement the time jumps. | ||
You shouldn't assume that the rules you're familiar with from a local time zone translate to other zones. | ||
|
||
One difference that often catches out developers is that some zones change clocks at midnight. | ||
A good example comes from Jordan (`Asia/Amman`) in 2021: | ||
|
||
* One second after `2021-03-25 23:59:59` was `2022-03-26 01:00:00` (DST started). | ||
* One second after `2021-10-29 00:59:59` was `2022-10-29 00:00:00` (DST stopped). | ||
|
||
This creates the situation where midnight at the start of March 26 **didn't happen**, while midnight on October 29 happened twice. | ||
|
||
Moment Timezone accounts for these oddities as described in the ["Parsing Ambiguities" documentation](/timezone/docs/#/using-timezones/parsing-ambiguous-inputs/). | ||
But applications can still have bugs when they make other assumptions about time jumps, especially regarding the start of a day. | ||
So be aware that **a day doesn't always start at midnight**. |