Working with Time is Easy
summary
Dates and times break code because types and meanings are mixed; adopt distinct concepts: instant (epoch-based), local date/time vs zone/offset date time, period vs duration. Use a real library (he recommends Noda Time on .NET), inject a clock for tests, log with invariant culture, prefer IANA time zones over Windows names, and “store the information you have” (don’t convert future local datetimes to UTC). Keep timezone DBs updated (about 10 rule changes last year) and write tests for skipped/ambiguous local times.
AI-written summary · about
chapters (18)
- 0:00Introduction and premise
- 3:04Using C# Pad for examples
- 3:50Concepts and tooling
- 5:50Identifying pain points
- 8:28Instants and durations
- 13:14Intervals and intervals
- 15:32Calendars and local time
- 19:10Time zones and offsets
- 24:24Zoned date times
- 28:40Offset date times
- 31:41Period arithmetic
- 40:20Domain-specific types
- 45:00Arithmetic and design
- 47:00Database best practices
- 52:13Handling conversions
- 55:02Cultures and formatting
- 57:05Testability and rules
- 1:00:00Final recommendations
related talks
01h 00mDates and times aren't that hard - honestly!
48mWorking with date and time data in .NET
42mWorking with Dates and Times (It's Possible!)
52mIt's about time
50mIt’s About Time! Practical examples of time zones in TypeScript
27mI have a Date
51mBeyond DateTime: a bulletproof approach to date and time
40mTime, Numbers, Text
