~/talk

Date and Time in Swift - Date Handling in Swift Programming

Talkat Swift Craft 2024 · 2024-05-21..05-24· [swift, web-platform]
slides:none on file

Covers concrete Swift APIs and gotchas: how Date stores a monotonic seconds count, why Apple uses a 2001 reference (difference 978307200 seconds from 1970), and how 32‑bit Unix time overflows push choices. Shows practical use of Calendar, DateComponents and formatters, explains why date(byAdding:) (adds intervals) differs from building dates with date(from:) (matches closest valid components), and describes building a robust month display using only year/month/day and tests for DST and leap‑year edge cases.

AI-written summary · about

  1. 0:00Introduction and humor
  2. 1:03Why date handling is tricky
  3. 2:30How computers represent dates
  4. 6:26Human vs computer time
  5. 7:08The Gregorian calendar history
  6. 11:02Working with calendars in Swift
  7. 11:45Date formatting basics
  8. 14:14Advanced date formatters
  9. 15:16Swift format styles
  10. 17:44Date components explained
  11. 23:01Understanding time zones
  12. 29:01Time zone complexities
  13. 31:52Practical date advice
  14. 33:16Testing date handling
  15. 35:01Daylight saving time pitfalls
  16. 41:00Summary and key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.