12-Hour vs 24-Hour Time

  • 12-hour (AM/PM): US, Canada, Australia, Philippines—'3:00 PM'
  • 24-hour (military): Most of Europe, Asia, Latin America—'15:00'
  • Fun fact: Japan uses both! 24-hour for trains, 12-hour in casual speech

Time Format Standards Explained

  • ISO 8601: 2024-01-15T14:30:00Z — International standard, the 'T' separates date and time
  • RFC 3339: Internet's date-time format, based on ISO 8601 but stricter
  • Unix timestamp: Seconds since Jan 1, 1970 — 1705330200 = Jan 15, 2024 14:30 UTC
  • UTC: Coordinated Universal Time — the 'base' timezone (no DST changes)

Midnight & Noon Confusion

  • 12:00 AM: Midnight — start of day (00:00 in 24-hour)
  • 12:00 PM: Noon — middle of day (12:00 in 24-hour)
  • 12:01 AM: One minute after midnight (00:01)
  • Pro tip: Use 00:00 and 12:00 to avoid confusion in formal contexts
  • Airlines: Use 23:59 or 00:01 to avoid midnight ambiguity

Exotic Time Systems (Yes, These Are Real)

  • Swatch .beats: 1000 beats/day, no timezones—@500 means noon in Switzerland
  • Decimal time: French Revolution tried 10-hour days (1793-1805), failed spectacularly
  • Julian Day: Astronomers count days since 4713 BC—today is around JD 2460000
  • Stardate: Star Trek made it up, but fans created real calculation systems

Unix Timestamp Milestones

  • 0: Jan 1, 1970 00:00:00 UTC — 'The Epoch', Unix's birthday
  • 1000000000: Sep 9, 2001 01:46:40 UTC — '1 billion seconds' party
  • 1234567890: Feb 13, 2009 23:31:30 UTC — developers celebrated
  • 2147483647: Jan 19, 2038 03:14:07 UTC — Y2K38 bug (32-bit overflow!)
  • Negative: Timestamps before 1970 are negative (-1 = Dec 31, 1969 23:59:59)

Programming Time Gotchas

  • JavaScript Date.getMonth() is 0-indexed: January = 0, December = 11
  • Milliseconds vs seconds: JS uses ms, Unix uses seconds—divide by 1000
  • Timezone offsets flip: UTC-5 means 5 hours BEHIND UTC, but offset is +5
  • Leap seconds: 2016 had a 61-second minute (23:59:60 existed!)
  • Time zones aren't hours: India is UTC+5:30, Nepal is UTC+5:45

Developer Use Cases

  • Log analysis: Convert timestamps to human-readable for debugging
  • API responses: Format ISO 8601 times for consistent JSON output
  • Database queries: Convert user input to Unix timestamp for comparison
  • Cron jobs: Understand UTC vs local time for scheduled tasks
  • JWT tokens: 'exp' and 'iat' claims are Unix timestamps

Quick Conversions

  • 1 hour: 3600 seconds
  • 1 day: 86400 seconds
  • 1 week: 604800 seconds
  • 1 year: ~31536000 seconds (31557600 with leap year avg)
  • 100 years: ~3.15 billion seconds (fits in 32-bit signed int... barely)