Dates, times and time zones
Nine o'clock is not the same moment everywhere. Test reminders and due dates across zones, clock changes, midnight and month ends, and store one common time.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a phone call to a friend abroad. Nine o'clock for you is another hour for them. Last night their clocks changed, so even the gap between you has moved.
Daily List is a to-do list app. Lily sets a reminder for 9:00 to take her medicine. Then she flies to another country. Tom, the tester, wants to know when the reminder rings.
Lily's home is in one , a region with the same standard time. Her new city is in another. To compare them, programs use , the common world time standard that other zones are measured against.
Twice a year many places move their clocks. This is . Moving clocks forward and back during the year can make an hour disappear or happen twice.
Before testing, Tom asks whether the reminder follows the same instant, the home zone or the user's current local civil time. He then selects three zones and a specific transition and checks the declared rule, including any missing or repeated local time policy.
The picture has a limit. A phone call needs two people to agree on a time. A program must decide alone which clock to trust.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Distinguishing an instant, a future local schedule and a date-only value before applying the intended time-zone rule.
- Store the common time
- Show the local time
- Ask for the rule
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| Call to a friend abroad | Two users in two zones |
| Your clock | Local time |
| A shared clock both agree on | UTC |
| Clocks changing last night | Daylight saving |
WHERE THIS PICTURE STOPS
- The common-clock picture fits identified instants; future local schedules and date-only values need additional rules.
- Friends tell each other the hour. A program needs a stored rule.
- Clocks change by hand in a house. A phone may update by itself, or not at all.
HOOK
For instants: store one, show local.
REMEMBER IT THIS WAY
A contrast: two neighbours told apart by one test.
For an identified instant, provides a common clock for local display. A future local schedule or date-only value needs its own meaning and rule.
| In the trick | What it stands for |
|---|---|
| local time | The standard time in Lily's region |
| UTC | The common world time standard that other zones are measured against |
TELL A FRIEND
A phone call to a friend abroad, with clocks that changed last night. Agree on one shared clock.
OFTEN MIXED UP WITH Boundaries in dates, lengths, lists and sizes. The boundaries lesson looks for edges in values. Midnight and clock changes are edges in time.
PRACTISE AND KEEP
Sources for this topic — 11 sources
- Market practice
Date and Time on the Internet: Timestamps (Request for Comments 3339) ↗ — IETF · Each time has a stated offset from UTC, the suffix Z means offset zero, and UTC is recommended because local zone rules can change (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Request for Comments (RFC) 3339, July 2002. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Time zone and daylight saving time data (Internet Assigned Numbers Authority) ↗ — Internet Assigned Numbers Authority (IANA) · The time zone database holds the history of local time and is updated when governments change boundaries or daylight saving rules, with no fixed release schedule (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Daylight saving time (DST) transition edge cases: lost and repeated hours (InventiveHQ blog) ↗ — InventiveHQ · Clocks going forward skip an hour and clocks going back repeat one; tests should use past transition dates and several zones (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
PostgreSQL documentation ↗ — The PostgreSQL Global Development Group · A timestamp with time zone is stored in UTC and shown in the session zone; one without a zone ignores any offset in the input (search excerpt, page not opened)
An implementation, not the standard — which is the point. ISO/IEC 9075-2 is paywalled, and this documents the same constructs in text anybody can open. Its isolation-level chapter attributes to the standard explicitly, so it can carry a standard-level claim as long as the citation says which document it is quoting.
Cited as market practice rather than an official standard by kind: an engine's manual is authoritative about that engine and is not the obligation. Where a question turns on behaviour PostgreSQL chose rather than behaviour SQL requires, the answer has to say so.
One correction carried here because it circulates widely: the sentence "The fundamental difference between WHERE and HAVING…", quoted all over the internet as PostgreSQL documentation, is not in the current documentation. It was searched for in the source tree and is not there.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read from the
postgres/postgresdocumentation source tree (doc/src/sgml), which the project itself maintains and which carries the section ids the published URLs are derived from — so a cited section id can be checked against the rendered page. - Market practice
Date.prototype.getTimezoneOffset() (Mozilla developer docs, JavaScript reference) ↗ — Mozilla (developer documentation) · getTimezoneOffset gives the gap in minutes between UTC and the host computer's zone, and it changes with daylight saving (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
ISO 8601 — Date and time format ↗ — International Organization for Standardization · ISO 8601 sets a written format for dates and times (registry entry)
Search excerpts only, page not opened. The standard is published in two parts — ISO 8601-1 basic rules and ISO 8601-2 extensions — and the full text is a paid publication. ISO 20022 elements reach these representations through XML Schema datatypes rather than by citing the standard directly, so the schema, not ISO 8601, decides which optional components a given element may omit.
- Market practice
Year 2038 problem ↗ — Wikipedia · Wikipedia Year 2038 and IERS Bulletin C guide. Search excerpts, pages not opened. Wikipedia excerpt gives 03:14:07 for the last good second.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Bulletin C: guide to leap second announcements ↗ — IERS (Earth Orientation Centre, Paris Observatory) · Wikipedia Year 2038 and IERS Bulletin C guide. Search excerpts, pages not opened. Wikipedia excerpt gives 03:14:07 for the last good second.
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Date column in a report one day behind (Pega community) ↗ — Pega · Checked on PostgreSQL 16.15: 2026-10-15 23:30 at -04:00 is 2026-10-16 in UTC and 2026-10-15 in New York. Real reports of the fault: Pega community and Adobe Workfront community threads (search excerpts, pages not opened).
Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Working with Time and Timezones — Group Draft Note (26 July 2025) ↗ — W3C Internationalization Working Group · Group Draft Note26July2025,4.2.1–4.2.4: past instants, future zone rules, recurrence and floating civil dates; informative work in progress (relevant primary passages opened6November2026).
Opened relevant primary passages on6November2026 via normal web search and document view. Sections4.2.1–4.2.4 opened for past/future/recurring/floating time values. Informative work in progress, not a Recommendation or endorsed W3C standard; no use of its stale leap-second frequency.
- Market practice
Working with Time and Timezones — Group Draft Note (26 July 2025) ↗ — W3C Internationalization Working Group · Working with Time and Timezones, Group Draft Note26July2025: complete publication/status,4.2/4.2.1–4.2.4 and3.4.3FloatingTime/Example6 read7November2026. Informative work in progress, not Recommendation/member endorsement; instant versus future civil time, recurrence and date-only intent. Not database/language API certification.
Opened relevant primary passages on6November2026 via normal web search and document view. Sections4.2.1–4.2.4 opened for past/future/recurring/floating time values. Informative work in progress, not a Recommendation or endorsed W3C standard; no use of its stale leap-second frequency.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.