Slide 1

Slide 1 text

WHAT'S THE TIME ? Joachim Jablon - DjangoCon Europe '16 April 2016 (±10%) 1

Slide 2

Slide 2 text

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 !

Slide 3

Slide 3 text

• Nepal • Brazil • Australia 3 TIME TROLLING, PT. 2

Slide 4

Slide 4 text

THIS IS MADNESS 4 This is Australiaaaaaaaaa !

Slide 5

Slide 5 text

PYTHON TRIES TO HELP • time • calendar • datetime :
 date, time, datetime, timedelta, tzinfo 5

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

7

Slide 8

Slide 8 text

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'

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

10 Thank you Related XKCD : xkcd://1061 @ewjoachim