$30 off During Our Annual Pro Sale. View Details »

What's the time ?

What's the time ?

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

Joachim Jablon

May 08, 2016
Tweet

More Decks by Joachim Jablon

Other Decks in Programming

Transcript

  1. 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 !
  2. PYTHON TRIES TO HELP • time • calendar • datetime

    :
 date, time, datetime, timedelta, tzinfo 5
  3. 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
  4. 7

  5. 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'
  6. 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