Skip to content

Commit 9ef2c65

Browse files
committed
Doc: fix bogus example about ambiguous timestamps.
I had a brain fade in commit d328991, and used 2:30AM as the example timestamp for both spring-forward and fall-back cases. But it's not actually ambiguous at all in the fall-back case, because that transition is from 2AM to 1AM under USA rules. Fix the example to use 1:30AM, which *is* ambiguous. Noted while answering a question from Aleksander Alekseev. Back-patch to all supported branches. Discussion: https://postgr.es/m/2191355.1641828552@sss.pgh.pa.us
1 parent 90657b4 commit 9ef2c65

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

doc/src/sgml/datetime.sgml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,27 +210,25 @@
210210
<para>
211211
Conversely, consider the behavior during a fall-back transition:
212212
<programlisting>
213-
=&gt; SELECT '2018-11-04 02:30'::timestamptz;
213+
=&gt; SELECT '2018-11-04 01:30'::timestamptz;
214214
timestamptz
215215
------------------------
216-
2018-11-04 02:30:00-05
216+
2018-11-04 01:30:00-05
217217
(1 row)
218218
</programlisting>
219-
On that date, there were two possible interpretations of 2:30AM; there
220-
was 2:30AM EDT, and then an hour later after the reversion to standard
221-
time, there was 2:30AM EST.
219+
On that date, there were two possible interpretations of 1:30AM; there
220+
was 1:30AM EDT, and then an hour later after clocks jumped back from
221+
2AM EDT to 1AM EST, there was 1:30AM EST.
222222
Again, <productname>PostgreSQL</productname> interprets the given time
223-
as if it were standard time (UTC-5). We can force the matter by
224-
specifying daylight-savings time:
223+
as if it were standard time (UTC-5). We can force the other
224+
interpretation by specifying daylight-savings time:
225225
<programlisting>
226-
=&gt; SELECT '2018-11-04 02:30 EDT'::timestamptz;
226+
=&gt; SELECT '2018-11-04 01:30 EDT'::timestamptz;
227227
timestamptz
228228
------------------------
229-
2018-11-04 01:30:00-05
229+
2018-11-04 01:30:00-04
230230
(1 row)
231231
</programlisting>
232-
This timestamp could validly be rendered as either 2:30 UTC-4 or
233-
1:30 UTC-5; the timestamp output code chooses the latter.
234232
</para>
235233

236234
<para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy