Time Zone Pitfalls
- 17Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is the primary advice regarding dealing with time zones in programming?
Programmers should never, ever deal with time zones if they can help it.
Or swipe the card
17 cards
What is the primary advice regarding dealing with time zones in programming?
Programmers should never, ever deal with time zones if they can help it.
What specific challenge do countries like Australia and Nepal present regarding time zones?
They have half-hour or quarter-hour offsets from Greenwich Mean Time (e.g., Australia 9.5 hours, Nepal 5.75 hours).
How do Daylight Saving Time (DST) changes add complexity to time zone programming?
DST changes occur on different dates in different regions, even within the same country, and can involve shifting clocks forward or backward.
What dramatic time zone change occurred in Samoa, and why?
Samoa skipped a day (December 30, 2011) to shift from being behind Greenwich to ahead of Greenwich, to aid trading with Australia.
What is the significance of the file that tracks time zone changes for countries?
This file contains historical and future time zone changes for every country, which happen frequently and are announced ahead of schedule.
Describe 'Double British Summertime' during World War II.
England went on British Summertime (BST) and then added an extra hour, making it 2 hours ahead of Greenwich.
What issue arose in Libya in 2013 concerning time zone changes?
Libya decided with only a couple of days' notice not to put clocks back for autumn, causing all Libyan computers to be an hour out.
How does the West Bank demonstrate the complexity of time zones within a single geographical area?
The Israeli and Palestinian populations follow different time zones in the same location, as one follows Israel's time and the other doesn't.
What historical calendar change complicates time calculations for historians?
The switch from the Julian calendar to the Gregorian calendar involved skipping several weeks or specific dates, depending on the location and historical period.
When did Russia switch to the Gregorian calendar, and what impact did it have?
Russia switched to the Gregorian calendar only in the 20th century, and the specific skipped dates depended on the location.
How did the start of the year in Britain complicate historical date calculations until the 16th century?
Until the 16th century, the year in Britain started on March 25th, meaning December 31st, 924 was followed by January 1st, 924, then March 25th, 925.
What is a 'leap second,' and why does it occur?
A leap second is an extra second (23:59:60) added to a minute because the Earth's rotation speed is not constant.
What is the primary problem caused by a leap second in computer systems?
It causes everything to break because suddenly there are 61 seconds in a minute, leading to clocks being out of sync or repeating a second.
What is the 'Unix timestamp' meant to solve for time calculations?
It is a number that increments one second per second consistently starting from January 1, 1970, 00:00:00 UTC, designed to deal with leap seconds.
Why does the Unix timestamp not fully solve the leap second problem?
It doesn't fully solve it because there are Universal Coordinated Time (UTC), which includes leap seconds, and astronomical time, which does not and drifts out of sync.
What is the recommended approach for programmers dealing with time zones, given their complexity?
Programmers should use existing, open-source libraries developed by experts who have already tackled these issues, and never try to write their own time zone code.
Describe Google's 'leap smear' approach to handling leap seconds.
Google smears the extra second out over the entire day, slightly increasing the clock's tick rate microscopically at a time.

Ask anything
We've read this whole study set, so questions about it get the best answers.