What Time Is It, Anyway
summary
Explains why pre-Java-8 Date/Calendar/SimpleDateFormat are broken (not thread-safe, zero-based months) and shows three real failures: a regex used to extract time, manual string assembly for hours/minutes/seconds, and a unit test that broke on New Year due to mixing hard-coded year with dynamic now. Describes migration path: Joda-Time then Java 8 java.time with classes like LocalDate/LocalTime/ZonedDateTime/Instant, how withZoneSameInstant converts zones, how Unix epoch (1970) and the year 2038 overflow matter, and testing by injecting a time factory.
AI-written summary · about
chapters (23)
- 0:00Introduction and overview
- 2:06Speaker background
- 3:28Why Java date time matters
- 4:10Worst date time code examples
- 8:20Problems with original API
- 9:22History of time measurement
- 15:43Prime meridian and UTC
- 17:30Atomic clocks and leap seconds
- 19:19Coordinated Universal Time
- 21:05Unix epoch and year 2038
- 23:14ISO 8601 standard
- 25:41Lunar Coordinated Time
- 26:22Early Java date time API
- 28:11Joda Time framework
- 29:58Java 8 date time classes
- 33:08Local date time basics
- 34:13Zone date time explained
- 38:36Instant and time conversion
- 41:28Periods and durations
- 44:58Key methods and usage
- 47:05Java 8 and JSR 310
- 48:27Unit testing with dates
- 50:57Resources and closing
