Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's the time ?

What's the time ?

A ranting of an angry dev on Time zones, DST and insanity

E122b75d171a1029ba808f7e26af1820?s=128

Joachim Jablon

May 08, 2016
Tweet

More Decks by Joachim Jablon

Other Decks in Programming

Transcript

  1. WHAT'S THE TIME ? Joachim Jablon - DjangoCon Europe '16

    April 2016 (±10%) 1
  2. TIME TROLLING, PT. 1 • 1 minute = 60 seconds*

    • 1 hour = 60 minutes ** • 1 day = 24 hours (starting at midnight)*** • 1 week = 7 days (starting on Monday) **** • 1 month = 30 days = 4 weeks • 1 year = 12 months (starting on Jan. 1st) ***** = 365 days ****** 2 * Except minutes that have a leap second and can be 59 or 61 ** Except DST hours that can be anything from 0 to 120 minutes *** Except DST days that can be 22 to 26 hours **** Except in the places where it starts on Sunday ***** But the ISO year might begin on Dec. 29, ****** Except leap years. Are you really reading all the fine prints here ? Congratulations !
  3. • Nepal • Brazil • Australia 3 TIME TROLLING, PT.

    2
  4. THIS IS MADNESS 4 This is Australiaaaaaaaaa !

  5. PYTHON TRIES TO HELP • time • calendar • datetime

    :
 date, time, datetime, timedelta, tzinfo 5
  6. Python documentation « Supporting timezones at whatever level of detail

    is required is up to the application. The rules for time adjustment across the world are more political than rational, and there is no standard suitable for every application. » 6
  7. 7

  8. TZ DATA, PYTZ 8 TZ Data: Arthur David Olson, Paul

    Eggert, Pytz: Stuart Bishop Quick reminder : have you sent your happiness packets yet ? Just sayin'
  9. KEEPING YOUR SANITY • The spoon naive datetime does not

    exist • Use UTC everywhere while you can, use TIME_ZONE="UTC" in your settings. • Always be aware of the time zone you're using, not just the UTC shift • ♥ opensource (check out "Arrow" and "DeLorean" python libs) 9
  10. 10 Thank you Related XKCD : xkcd://1061 @ewjoachim