In programming languages
How real languages and libraries model time, with runnable examples.
Python
datetime, the aware-vs-naive trap, and zoneinfo.
JavaScript
Date pitfalls, the Temporal API, and Intl for formatting.
Java
java.time (JSR-310), Instant vs LocalDateTime, and the legacy Date/Calendar minefield.
Kotlin
kotlinx-datetime, Instant vs LocalDateTime, and java.time interop.
Swift
Foundation’s Date, Calendar/DateComponents, and the en_US_POSIX trap.
Go
The time package — instants carrying a Location, the reference layout, and no civil types.
Rust
std has no calendar — jiff’s Timestamp, Zoned, and civil types, with chrono field notes.
C
<time.h> — time_t vs struct tm, the year-1900/month-0 breakdown, and process-global zones.
C++
C++20 — sys_time vs local_time vs zoned_time, year_month_day, and std::format.