Dates and times: Hard, but not impossible
summary
Dates and times are manageable with the right choices: prefer Noda Time types (Instant, LocalDateTime, ZonedDateTime) over System.DateTime, inject a testable clock instead of DateTime.Now, and treat durations (fixed seconds) separately from periods (months/years). Storing UTC timestamps often hides required context—scheduling nine AM later must preserve the original zone rules—so record zone/version when needed. Leap seconds are rare; limit scope to what the app actually needs and document why each date/time type was chosen.
AI-written summary · about
chapters (12)
- 0:00Introduction and kindness reminder
- 1:24Why dates and times are hard
- 4:14Key concepts in date and time handling
- 10:00Instant in time explained
- 12:03Calendar systems and local time
- 18:05Understanding time zones
- 30:07Durations and periods
- 32:59Q&A on NodaTime and .NET design
- 46:05Bad practices to avoid
- 53:14How to improve date and time code
- 1:06:38Summary and final advice
- 1:07:42Closing and kindness message
