From 1fbca2d98d6f2d0511dd4f9a3cf96e3543964b4f Mon Sep 17 00:00:00 2001 From: Gilmore Davidson Date: Tue, 2 May 2023 16:47:26 +1000 Subject: [PATCH] Add a timezone guide for DST jumps at midnight --- .../01-data-calculations/03-dst-jumps.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 guides/moment-timezone/01-data-calculations/03-dst-jumps.md diff --git a/guides/moment-timezone/01-data-calculations/03-dst-jumps.md b/guides/moment-timezone/01-data-calculations/03-dst-jumps.md new file mode 100644 index 00000000..5fe79689 --- /dev/null +++ b/guides/moment-timezone/01-data-calculations/03-dst-jumps.md @@ -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**.