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

A Day Has Only 24±1 Hours (Israel, 2021-01-04)

A Day Has Only 24±1 Hours (Israel, 2021-01-04)

Miroslav Šedivý

January 04, 2021
Tweet

More Decks by Miroslav Šedivý

Other Decks in Programming

Transcript

  1. A Day Has Only 24±1 Hours
    Miroslav Šedivý
      eumiro
    1

    View Slide

  2. A Day Has Only 24±1 Hours
      eumiro 2

    View Slide

  3. A Day Has Only 24±1 Hours
    check the time
      eumiro 2

    View Slide

  4. A Day Has Only 24±1 Hours
    check the time
    don't check the time too often
      eumiro 2

    View Slide

  5. A Day Has Only 24±1 Hours
    check the time
    don't check the time too often
    check what your government does
      eumiro 2

    View Slide

  6. Miroslav Šedivý
    [ˈmɪrɔslaʋ ˈʃɛɟɪviː]
      eumiro 3

    View Slide

  7. Miroslav Šedivý
    [ˈmɪrɔslaʋ ˈʃɛɟɪviː]
    born in Bratislava, Czechoslovakia (TZ=Europe/Bratislava)
      eumiro 3

    View Slide

  8. Miroslav Šedivý
    [ˈmɪrɔslaʋ ˈʃɛɟɪviː]
    born in Bratislava, Czechoslovakia (TZ=Europe/Bratislava)
    M.Sc. at INSA Lyon, France (TZ=Europe/Paris)
      eumiro 3

    View Slide

  9. Miroslav Šedivý
    [ˈmɪrɔslaʋ ˈʃɛɟɪviː]
    born in Bratislava, Czechoslovakia (TZ=Europe/Bratislava)
    M.Sc. at INSA Lyon, France (TZ=Europe/Paris)
    Pythonista at solute GmbH, Karlsruhe, Germany (TZ=Europe/Berlin)
      eumiro 3

    View Slide

  10. Miroslav Šedivý
    [ˈmɪrɔslaʋ ˈʃɛɟɪviː]
    born in Bratislava, Czechoslovakia (TZ=Europe/Bratislava)
    M.Sc. at INSA Lyon, France (TZ=Europe/Paris)
    Pythonista at solute GmbH, Karlsruhe, Germany (TZ=Europe/Berlin)
      eumiro 3

    View Slide

  11. Monday, 4th January 2021
    18:10 IST (Jerusalem, Israel)
      eumiro 4

    View Slide

  12. >>> import datetime
    >>> datetime.datetime.now()
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0) # in Jerusalem
    datetime.datetime(2021, 1, 4, 17, 10, 0, 0) # in Karlsruhe
      eumiro 5

    View Slide

  13. >>> import datetime
    >>> datetime.datetime.now()
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0) # in Jerusalem
    datetime.datetime(2021, 1, 4, 17, 10, 0, 0) # in Karlsruhe
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # UTC
      eumiro 5

    View Slide

  14. >>> import datetime
    >>> datetime.datetime.now()
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0) # in Jerusalem
    datetime.datetime(2021, 1, 4, 17, 10, 0, 0) # in Karlsruhe
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # UTC
    >>> datetime.datetime.utcnow()
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # everywhere
      eumiro 5

    View Slide

  15. >>> import datetime
    >>> datetime.datetime.now()
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0) # in Jerusalem
    datetime.datetime(2021, 1, 4, 17, 10, 0, 0) # in Karlsruhe
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # UTC
    >>> datetime.datetime.utcnow()
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # everywhere
    >>> datetime.datetime.now(datetime.timezone.utc)
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0, tzinfo=datetime.timezone.utc)
      eumiro 5

    View Slide

  16. >>> import datetime
    >>> datetime.datetime.now()
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0) # in Jerusalem
    datetime.datetime(2021, 1, 4, 17, 10, 0, 0) # in Karlsruhe
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # UTC
    >>> datetime.datetime.utcnow()
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # everywhere
    >>> datetime.datetime.now(datetime.timezone.utc)
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0, tzinfo=datetime.timezone.utc)
    >>> datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=2)))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(0, 7200)))
      eumiro 5

    View Slide

  17. >>> import datetime
    >>> datetime.datetime.now()
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0) # in Jerusalem
    datetime.datetime(2021, 1, 4, 17, 10, 0, 0) # in Karlsruhe
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # UTC
    >>> datetime.datetime.utcnow()
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0) # everywhere
    >>> datetime.datetime.now(datetime.timezone.utc)
    datetime.datetime(2021, 1, 4, 16, 10, 0, 0, tzinfo=datetime.timezone.utc)
    >>> datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=2)))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=datetime.timezone(datetime.timedelta(0, 7200)))
    >>> import zoneinfo
    >>> datetime.datetime.now(zoneinfo.ZoneInfo('Asia/Jerusalem'))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Asia/Jerusalem'))
      eumiro 5

    View Slide

  18. >>> import zoneinfo
    >>> datetime.datetime.now(zoneinfo.ZoneInfo('Asia/Jerusalem'))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Asia/Jerusalem'))
      eumiro 6

    View Slide

  19. >>> import zoneinfo
    >>> datetime.datetime.now(zoneinfo.ZoneInfo('Asia/Jerusalem'))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Asia/Jerusalem'))
    >>> from dateutil import tz
    >>> datetime.datetime.now(tz.gettz('Europe/Warsaw'))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=tzfile('/usr/share/zoneinfo/Asia/Jerusalem'))
      eumiro 6

    View Slide

  20. >>> import zoneinfo
    >>> datetime.datetime.now(zoneinfo.ZoneInfo('Asia/Jerusalem'))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Asia/Jerusalem'))
    >>> from dateutil import tz
    >>> datetime.datetime.now(tz.gettz('Europe/Warsaw'))
    datetime.datetime(2021, 1, 4, 18, 10, 0, 0, tzinfo=tzfile('/usr/share/zoneinfo/Asia/Jerusalem'))
    >>> import pytz
    >>> datetime.datetime.now(pytz.timezone('Asia/Jerusalem'))
    datetime.datetime(2020, 1, 4, 18, 10, 0, 0, tzinfo=)
      eumiro 6

    View Slide

  21. >>> date = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    >>> weekday = datetime.datetime.utcnow().strftime('%A')
    '2021-01-04'
    'Monday'
      eumiro 7

    View Slide

  22. >>> date = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    >>> weekday = datetime.datetime.utcnow().strftime('%A')
    '2021-01-04'
    'Monday'
    >>> now = datetime.datetime.utcnow()
    >>> date = now.strftime('%Y-%m-%d')
    >>> weekday = now.strftime('%A')
      eumiro 7

    View Slide

  23. >>> date = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    >>> weekday = datetime.datetime.utcnow().strftime('%A')
    '2021-01-04'
    'Monday'
    >>> now = datetime.datetime.utcnow()
    >>> date = now.strftime('%Y-%m-%d')
    >>> weekday = now.strftime('%A')
    Check the time only once!
      eumiro 7

    View Slide

  24. >>> start = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 0, 0)
    >>> expensive_operation()
    >>> end = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 1, 0)
    >>> elapsed = (end - start).total_seconds() # datetime.timedelta(seconds=1) -> 1.
      eumiro 8

    View Slide

  25. >>> start = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 0, 0)
    >>> expensive_operation()
    >>> end = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 1, 0)
    >>> elapsed = (end - start).total_seconds() # datetime.timedelta(seconds=1) -> 1.
    >>> one_second = datetime.timedelta(seconds=1)
    >>> elapsed = (end - start) / one_second # 1.
      eumiro 8

    View Slide

  26. >>> start = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 0, 0)
    >>> expensive_operation()
    >>> end = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 1, 0)
    >>> elapsed = (end - start).total_seconds() # datetime.timedelta(seconds=1) -> 1.
    >>> one_second = datetime.timedelta(seconds=1)
    >>> elapsed = (end - start) / one_second # 1.
    >>> start = time.time() # 1609776600.0
    >>> expensive_operation()
    >>> end = time.time() # 1609776601.0
    >>> elapsed = end - start # 1.0
      eumiro 8

    View Slide

  27. >>> start = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 0, 0)
    >>> expensive_operation()
    >>> end = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 1, 0)
    >>> elapsed = (end - start).total_seconds() # datetime.timedelta(seconds=1) -> 1.
    >>> one_second = datetime.timedelta(seconds=1)
    >>> elapsed = (end - start) / one_second # 1.
    >>> start = time.time() # 1609776600.0
    >>> expensive_operation()
    >>> end = time.time() # 1609776601.0
    >>> elapsed = end - start # 1.0
    >>> start = time.monotonic() # 5.0
    >>> expensive_operation()
    >>> end = time.monotonic() # 6.0
    >>> elapsed = end - start # 1.0
      eumiro 8

    View Slide

  28. >>> start = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 0, 0)
    >>> expensive_operation()
    >>> end = datetime.datetime.utcnow() # datetime.datetime(2021, 1, 4, 16, 10, 1, 0)
    >>> elapsed = (end - start).total_seconds() # datetime.timedelta(seconds=1) -> 1.
    >>> one_second = datetime.timedelta(seconds=1)
    >>> elapsed = (end - start) / one_second # 1.
    >>> start = time.time() # 1609776600.0
    >>> expensive_operation()
    >>> end = time.time() # 1609776601.0
    >>> elapsed = end - start # 1.0
    >>> start = time.monotonic() # 5.0
    >>> expensive_operation()
    >>> end = time.monotonic() # 6.0
    >>> elapsed = end - start # 1.0
    >>> time.monotonic_ns() # 6000000000
      eumiro 8

    View Slide

  29.   eumiro 9

    View Slide

  30. >>> len(pytz.common_timezones)
    440
      eumiro 10

    View Slide

  31. >>> len(pytz.common_timezones)
    440
      eumiro 10

    View Slide

  32. https://www.iana.org/time-zones
      eumiro 11

    View Slide

  33. https://www.iana.org/time-zones
      eumiro 11

    View Slide

  34. tzdata2020f.tar.gz (2020-12-29, 402kB)
      eumiro 12

    View Slide

  35. tzdata2020f.tar.gz (2020-12-29, 402kB)
    3042 5. Okt 2018 CONTRIBUTING 182458 22. Dez 22:05 europe
    252 25. Mai 2017 LICENSE 404 17. Jun 2019 factory
    44015 23. Dez 20:21 Makefile 4463 20. Feb 2019 iso3166.tab
    186547 29. Dez 09:18 NEWS 10662 9. Jul 21:59 leap-seconds.list
    2424 19. Aug 05:47 README 3388 25. Okt 22:43 leapseconds
    69921 11. Dez 04:39 africa 8889 25. Okt 22:43 leapseconds.awk
    13743 4. Okt 00:07 antarctica 169355 5. Dez 19:39 northamerica
    177139 27. Okt 19:32 asia 88277 4. Okt 00:07 southamerica
    94449 5. Dez 19:32 australasia 60781 25. Nov 07:07 theory.html
    4680 25. Nov 00:40 backward 6 29. Dez 09:18 version
    26223 25. Nov 00:40 backzone 4188 23. Dez 20:21 ziguard.awk
    5567 2. Okt 2017 calendars 8347 3. Okt 23:58 zishrink.awk
    1008 2. Jun 2017 checklinks.awk 19321 2. Dez 05:52 zone.tab
    4473 22. Jun 2019 checktab.awk 17835 2. Dez 05:52 zone1970.tab
    2704 22. Okt 21:47 etcetera 1450 4. Okt 00:07 zoneinfo2tdf.pl
      eumiro 12

    View Slide

  36.   eumiro 13

    View Slide

  37. Asia/Jerusalem
      eumiro 14

    View Slide

  38. # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Asia/Jerusalem 2:20:54 - LMT 1880
    2:20:40 - JMT 1918 # Jerusalem Mean Time?
    2:00 Zion I%sT
      eumiro 15

    View Slide

  39. # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Asia/Jerusalem 2:20:54 - LMT 1880
    2:20:40 - JMT 1918 # Jerusalem Mean Time?
    2:00 Zion I%sT
    # From Ephraim Silverberg (2001-01-11):
    #
    # I coined "IST/IDT" circa 1988. Until then there were three
    # different abbreviations in use:
    #
    # JST Jerusalem Standard Time [Danny Braniss, Hebrew University]
    # IZT Israel Zonal (sic) Time [Prof. Haim Papo, Technion]
    # EEST Eastern Europe Standard Time [used by almost everyone else]
      eumiro 15

    View Slide

  40. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 1940 only - May 31 24:00u 1:00 D
    Rule Zion 1940 only - Sep 30 24:00u 0 S
    Rule Zion 1940 only - Nov 16 24:00u 1:00 D
    Rule Zion 1942 1946 - Oct 31 24:00u 0 S
    Rule Zion 1943 1944 - Mar 31 24:00u 1:00 D
    Rule Zion 1945 1946 - Apr 15 24:00u 1:00 D
    Rule Zion 1948 only - May 22 24:00u 2:00 DD
    Rule Zion 1948 only - Aug 31 24:00u 1:00 D
    Rule Zion 1948 1949 - Oct 31 24:00u 0 S
    Rule Zion 1949 only - Apr 30 24:00u 1:00 D
    Rule Zion 1950 only - Apr 15 24:00u 1:00 D
    Rule Zion 1950 only - Sep 14 24:00u 0 S
    Rule Zion 1951 only - Mar 31 24:00u 1:00 D
    Rule Zion 1951 only - Nov 10 24:00u 0 S
    Rule Zion 1952 only - Apr 19 24:00u 1:00 D
    Rule Zion 1952 only - Oct 18 24:00u 0 S
    Rule Zion 1953 only - Apr 11 24:00u 1:00 D
    Rule Zion 1953 only - Sep 12 24:00u 0 S
    Rule Zion 1954 only - Jun 12 24:00u 1:00 D
    Rule Zion 1954 only - Sep 11 24:00u 0 S
    Rule Zion 1955 only - Jun 11 24:00u 1:00 D
    Rule Zion 1955 only - Sep 10 24:00u 0 S
    Rule Zion 1956 only - Jun 2 24:00u 1:00 D
    Rule Zion 1956 only - Sep 29 24:00u 0 S
    Rule Zion 1957 only - Apr 27 24:00u 1:00 D
    Rule Zion 1957 only - Sep 21 24:00u 0 S
    Rule Zion 1974 only - Jul 6 24:00 1:00 D
    Rule Zion 1974 only - Oct 12 24:00 0 S
    Rule Zion 1975 only - Apr 19 24:00 1:00 D
    Rule Zion 1975 only - Aug 30 24:00 0 S
      eumiro 16

    View Slide

  41. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 1980 only - Aug 2 24:00s 1:00 D
    Rule Zion 1980 only - Sep 13 24:00s 0 S
    Rule Zion 1984 only - May 5 24:00s 1:00 D
    Rule Zion 1984 only - Aug 25 24:00s 0 S
    Rule Zion 1985 only - Apr 13 24:00 1:00 D
    Rule Zion 1985 only - Aug 31 24:00 0 S
    Rule Zion 1986 only - May 17 24:00 1:00 D
    Rule Zion 1986 only - Sep 6 24:00 0 S
    Rule Zion 1987 only - Apr 14 24:00 1:00 D
    Rule Zion 1987 only - Sep 12 24:00 0 S
    Rule Zion 1988 only - Apr 9 24:00 1:00 D
    Rule Zion 1988 only - Sep 3 24:00 0 S
    Rule Zion 1989 only - Apr 29 24:00 1:00 D
    Rule Zion 1989 only - Sep 2 24:00 0 S
    Rule Zion 1990 only - Mar 24 24:00 1:00 D
    Rule Zion 1990 only - Aug 25 24:00 0 S
    Rule Zion 1991 only - Mar 23 24:00 1:00 D
    Rule Zion 1991 only - Aug 31 24:00 0 S
    Rule Zion 1992 only - Mar 28 24:00 1:00 D
    Rule Zion 1992 only - Sep 5 24:00 0 S
    Rule Zion 1993 only - Apr 2 0:00 1:00 D
    Rule Zion 1993 only - Sep 5 0:00 0 S
    Rule Zion 1994 only - Apr 1 0:00 1:00 D
    Rule Zion 1994 only - Aug 28 0:00 0 S
    Rule Zion 1995 only - Mar 31 0:00 1:00 D
    Rule Zion 1995 only - Sep 3 0:00 0 S
    Rule Zion 1996 only - Mar 14 24:00 1:00 D
    Rule Zion 1996 only - Sep 15 24:00 0 S
    Rule Zion 1997 only - Mar 20 24:00 1:00 D
    Rule Zion 1997 only - Sep 13 24:00 0 S
    Rule Zion 1998 only - Mar 20 0:00 1:00 D
    Rule Zion 1998 only - Sep 6 0:00 0 S
    Rule Zion 1999 only - Apr 2 2:00 1:00 D
    Rule Zion 1999 only - Sep 3 2:00 0 S
      eumiro 17

    View Slide

  42. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 2000 only - Apr 14 2:00 1:00 D
    Rule Zion 2000 only - Oct 6 1:00 0 S
    Rule Zion 2001 only - Apr 9 1:00 1:00 D
    Rule Zion 2001 only - Sep 24 1:00 0 S
    Rule Zion 2002 only - Mar 29 1:00 1:00 D
    Rule Zion 2002 only - Oct 7 1:00 0 S
    Rule Zion 2003 only - Mar 28 1:00 1:00 D
    Rule Zion 2003 only - Oct 3 1:00 0 S
    Rule Zion 2004 only - Apr 7 1:00 1:00 D
    Rule Zion 2004 only - Sep 22 1:00 0 S
    Rule Zion 2005 2012 - Apr Fri<=1 2:00 1:00 D
    Rule Zion 2005 only - Oct 9 2:00 0 S
    Rule Zion 2006 only - Oct 1 2:00 0 S
    Rule Zion 2007 only - Sep 16 2:00 0 S
    Rule Zion 2008 only - Oct 5 2:00 0 S
    Rule Zion 2009 only - Sep 27 2:00 0 S
    Rule Zion 2010 only - Sep 12 2:00 0 S
    Rule Zion 2011 only - Oct 2 2:00 0 S
    Rule Zion 2012 only - Sep 23 2:00 0 S
      eumiro 18

    View Slide

  43. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 2000 only - Apr 14 2:00 1:00 D
    Rule Zion 2000 only - Oct 6 1:00 0 S
    Rule Zion 2001 only - Apr 9 1:00 1:00 D
    Rule Zion 2001 only - Sep 24 1:00 0 S
    Rule Zion 2002 only - Mar 29 1:00 1:00 D
    Rule Zion 2002 only - Oct 7 1:00 0 S
    Rule Zion 2003 only - Mar 28 1:00 1:00 D
    Rule Zion 2003 only - Oct 3 1:00 0 S
    Rule Zion 2004 only - Apr 7 1:00 1:00 D
    Rule Zion 2004 only - Sep 22 1:00 0 S
    Rule Zion 2005 2012 - Apr Fri<=1 2:00 1:00 D
    Rule Zion 2005 only - Oct 9 2:00 0 S
    Rule Zion 2006 only - Oct 1 2:00 0 S
    Rule Zion 2007 only - Sep 16 2:00 0 S
    Rule Zion 2008 only - Oct 5 2:00 0 S
    Rule Zion 2009 only - Sep 27 2:00 0 S
    Rule Zion 2010 only - Sep 12 2:00 0 S
    Rule Zion 2011 only - Oct 2 2:00 0 S
    Rule Zion 2012 only - Sep 23 2:00 0 S
    # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
    Rule Zion 2013 max - Oct lastSun 2:00 0 S
      eumiro 18

    View Slide

  44. # According to the Office of the Secretary General of the Ministry of
    # Interior, there is NO set rule for Daylight-Savings/Standard time changes.
      eumiro 19

    View Slide

  45. # According to the Office of the Secretary General of the Ministry of
    # Interior, there is NO set rule for Daylight-Savings/Standard time changes.
    # One thing is entrenched in law, however: that there must be at least 150
    # days of daylight savings time annually.
      eumiro 19

    View Slide

  46. # According to the Office of the Secretary General of the Ministry of
    # Interior, there is NO set rule for Daylight-Savings/Standard time changes.
    # One thing is entrenched in law, however: that there must be at least 150
    # days of daylight savings time annually.
    # 1996 is an exception to this rule where the change back to standard
    # time took place on Sunday night instead of Saturday night to avoid
    # conflicts with the Jewish New Year.
      eumiro 19

    View Slide

  47. # According to the Office of the Secretary General of the Ministry of
    # Interior, there is NO set rule for Daylight-Savings/Standard time changes.
    # One thing is entrenched in law, however: that there must be at least 150
    # days of daylight savings time annually.
    # 1996 is an exception to this rule where the change back to standard
    # time took place on Sunday night instead of Saturday night to avoid
    # conflicts with the Jewish New Year.
    # Starting in 2001, all changes to/from will take place at 1 a.m. old time,
    # but now there is no rule as to what day of the week it will take place
    # in as the start date (except in 2003) is the night after the Passover
    # Seder (i.e. the eve of the 16th of Nisan in the lunar Hebrew calendar)
    # and the end date (except in 2002) is three nights before Yom Kippur
    # [Day of Atonement] (the eve of the 7th of Tishrei in the lunar Hebrew calendar).
      eumiro 19

    View Slide

  48. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
    Rule Zion 2013 max - Oct lastSun 2:00 0 S
      eumiro 20

    View Slide

  49. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
    Rule Zion 2013 max - Oct lastSun 2:00 0 S
    # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Asia/Jerusalem 2:20:54 - LMT 1880
    2:20:40 - JMT 1918 # Jerusalem Mean Time?
    2:00 Zion I%sT
      eumiro 20

    View Slide

  50. # Rule NAME FROM TO - IN ON AT SAVE LETTER/S
    Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
    Rule Zion 2013 max - Oct lastSun 2:00 0 S
    # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Asia/Jerusalem 2:20:54 - LMT 1880
    2:20:40 - JMT 1918 # Jerusalem Mean Time?
    2:00 Zion I%sT
    # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Asia/Gaza 2:17:52 - LMT 1900 Oct
    2:00 Zion EET/EEST 1948 May 15
    2:00 EgyptAsia EE%sT 1967 Jun 5
    2:00 Zion I%sT 1996
    2:00 Jordan EE%sT 1999
    2:00 Palestine EE%sT 2008 Aug 29 0:00
    2:00 - EET 2008 Sep
    2:00 Palestine EE%sT 2010
    2:00 - EET 2010 Mar 27 0:01
    2:00 Palestine EE%sT 2011 Aug 1
    2:00 - EET 2012
    2:00 Palestine EE%sT
    Zone Asia/Hebron 2:20:23 - LMT 1900 Oct
    2:00 Zion EET/EEST 1948 May 15
    2:00 EgyptAsia EE%sT 1967 Jun 5
    2:00 Zion I%sT 1996
    2:00 Jordan EE%sT 1999
    2:00 Palestine EE%sT
      eumiro 20

    View Slide

  51.   eumiro 21

    View Slide

  52.   eumiro 22

    View Slide

  53. Africa/Abidjan
    # Côte d'Ivoire / Ivory Coast
    # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Africa/Abidjan -0:16:08 - LMT 1912
    0:00 - GMT
      eumiro 23

    View Slide

  54. Africa/Abidjan
    # Côte d'Ivoire / Ivory Coast
    # Zone NAME STDOFF RULES FORMAT [UNTIL]
    Zone Africa/Abidjan -0:16:08 - LMT 1912
    0:00 - GMT
    Link Africa/Abidjan Africa/Bamako # Mali
    Link Africa/Abidjan Africa/Banjul # Gambia
    Link Africa/Abidjan Africa/Conakry # Guinea
    Link Africa/Abidjan Africa/Dakar # Senegal
    Link Africa/Abidjan Africa/Freetown # Sierra Leone
    Link Africa/Abidjan Africa/Lome # Togo
    Link Africa/Abidjan Africa/Nouakchott # Mauritania
    Link Africa/Abidjan Africa/Ouagadougou # Burkina Faso
    Link Africa/Abidjan Atlantic/St_Helena # St Helena
      eumiro 23

    View Slide

  55. Africa/Casablanca
    […]
    Rule Morocco 2080 only - Jun 16 3:00 -1:00 -
    Rule Morocco 2080 only - Jul 21 2:00 0 -
    Rule Morocco 2081 only - Jun 1 3:00 -1:00 -
    Rule Morocco 2081 only - Jul 13 2:00 0 -
    Rule Morocco 2082 only - May 24 3:00 -1:00 -
    Rule Morocco 2082 only - Jun 28 2:00 0 -
    Rule Morocco 2083 only - May 16 3:00 -1:00 -
    Rule Morocco 2083 only - Jun 20 2:00 0 -
    Rule Morocco 2084 only - Apr 30 3:00 -1:00 -
    Rule Morocco 2084 only - Jun 11 2:00 0 -
    Rule Morocco 2085 only - Apr 22 3:00 -1:00 -
    Rule Morocco 2085 only - May 27 2:00 0 -
    Rule Morocco 2086 only - Apr 14 3:00 -1:00 -
    Rule Morocco 2086 only - May 19 2:00 0 -
    Rule Morocco 2087 only - Mar 30 3:00 -1:00 -
    Rule Morocco 2087 only - May 11 2:00 0 -
    # For dates after the somewhat-arbitrary cutoff of 2087, assume that
    # Morocco will no longer observe DST. At some point this table will
    # need to be extended, though quite possibly Morocco will change the
    # rules first.
      eumiro 24

    View Slide

  56. Europe/Istanbul
    Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
      eumiro 25

    View Slide

  57. Europe/Istanbul
    Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
    Zone Europe/Istanbul 1:55:52 - LMT 1880
    1:56:56 - IMT 1910 Oct # Istanbul Mean Time?
    2:00 Turkey EE%sT 1978 Oct 15
    3:00 Turkey +03/+04 1985 Apr 20
    2:00 Turkey EE%sT 2007
    2:00 EU EE%sT 2011 Mar 27 1:00u
    2:00 - EET 2011 Mar 28 1:00u
    2:00 EU EE%sT 2014 Mar 30 1:00u
    2:00 - EET 2014 Mar 31 1:00u
    2:00 EU EE%sT 2015 Oct 25 1:00u
    2:00 1:00 EEST 2015 Nov 8 1:00u
    2:00 EU EE%sT 2016 Sep 7
    3:00 - +03
      eumiro 25

    View Slide

  58. Europe/Istanbul
    Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
    Zone Europe/Istanbul 1:55:52 - LMT 1880
    1:56:56 - IMT 1910 Oct # Istanbul Mean Time?
    2:00 Turkey EE%sT 1978 Oct 15
    3:00 Turkey +03/+04 1985 Apr 20
    2:00 Turkey EE%sT 2007
    2:00 EU EE%sT 2011 Mar 27 1:00u
    2:00 - EET 2011 Mar 28 1:00u
    2:00 EU EE%sT 2014 Mar 30 1:00u
    2:00 - EET 2014 Mar 31 1:00u
    2:00 EU EE%sT 2015 Oct 25 1:00u
    2:00 1:00 EEST 2015 Nov 8 1:00u
    2:00 EU EE%sT 2016 Sep 7
    3:00 - +03
    (2011-03-10): […] Turkey will change into summer time zone (GMT+3) on March 28, 2011 at 3:00 a.m.
    instead of March 27. This change is due to a nationwide exam on 27th. [URL] Turkish: [URL]
      eumiro 25

    View Slide

  59. 2:00 EU EE%sT 2014 Mar 30 1:00u
    2:00 - EET 2014 Mar 31 1:00u
    […] (2014-02-14): The DST for Turkey has been changed for this year because of the Turkish Local
    election.... [URL] ... so Turkey will move clocks forward one hour on March 31 at 3:00 a.m.
    […] (2014-04-15): Having landed on a flight from the states to Istanbul (via AMS) on March 31, I can
    tell you that NOBODY (even the airlines) respected this timezone DST change delay. Maybe the word
    just didn't get out in time.
    […] (2014-06-15): The press reported massive confusion, as election officials obeyed the rule change
    but cell phones (and airline baggage systems) did not. See: [URL from 2014-03-30] I guess the best we
    can do is document the official time.
      eumiro 26

    View Slide

  60. 2:00 EU EE%sT 2015 Oct 25 1:00u
    2:00 1:00 EEST 2015 Nov 8 1:00u
    […] (2015-09-29): It's officially announced now by the Ministry of Energy. Turkey delays winter time
    to 8th of November 04:00 [URL]
    BBC News (2015-10-25): Confused Turks are asking "what's the time?" after automatic clocks defied a
    government decision ... "For the next two weeks #Turkey is on EEST... Erdogan Engineered Standard
    Time," said Twitter user @aysekarahasan. [URL]
      eumiro 27

    View Slide

  61. 2:00 EU EE%sT 2016 Sep 7
    3:00 - +03
    […] (2016-09-08): Turkey will stay in Daylight Saving Time even in winter.... [URL]
    […] (2016-09-07): The change is permanent, so this is the new standard time in Turkey. It takes effect
    today, which is not much notice.
    […] (2017-10-28): Turkey will go back to Daylight Saving Time starting 2018-10. [URL]
    […] (2017-11-08): ... today it was announced that the DST will become "continuous": [URL]
    […] (2017-11-08): Although Google Translate misfires on that source, it looks like Turkey reversed last
    month's decision, and so will stay at +03.
      eumiro 28

    View Slide

  62. America/Caracas
    Zone America/Caracas -4:27:44 - LMT 1890
    -4:27:40 - CMT 1912 Feb 12 # Caracas Mean Time?
    -4:30 - -0430 1965 Jan 1 0:00
    -4:00 - -04 2007 Dec 9 3:00
    -4:30 - -0430 2016 May 1 2:30
    -4:00 - -04
    […] (2016-04-15): Clocks advance 30 minutes on 2016-05-01 at 02:30.... […] [URL from Reuters]
    […] (2016-04-20): ... published in the official Gazette [2016-04-18], here: [URL from .ve]
      eumiro 29

    View Slide

  63. America/Port-au-Prince
    Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D
    Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S
    Rule Haiti 2012 2015 - Mar Sun>=8 2:00 1:00 D
    Rule Haiti 2012 2015 - Nov Sun>=1 2:00 0 S
    Rule Haiti 2017 max - Mar Sun>=8 2:00 1:00 D
    Rule Haiti 2017 max - Nov Sun>=1 2:00 0 S
    […] (2005-04-15) […] wrote me that Haiti is now on DST. I searched for confirmation, and I found a
    press release on the Web page of the Haitian Consulate in Chicago (2005-03-31), […]
    […] (2006-04-04) I have been informed by users that Haiti observes DST this year like last year […]
    […] (2012-03-11) According to several news sources, Haiti will observe DST this year, apparently using
    the same start and end date as USA/Canada. […]
    […] (2013-03-10) It appears that Haiti is observing DST this year as well, same rules as US/Canada.
    They did it last year as well, and it looks like they are going to observe DST every year now... […]
    […] (2016-03-12) […] informed us that Haiti are not going on DST this year. […]
    […] (2017-03-12) We have received 4 mails from different people telling that Haiti has started DST
    again today, and this source seems to confirm that, I have not been able to find a more authoritative
    source: [URL]
      eumiro 30

    View Slide

  64. Asia/Seoul, Asia/Pyongyang
    Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 | Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
    8:30 - KST 1912 Jan 1 | 8:30 - KST 1912 Jan 1
    9:00 - JST 1945 Sep 8 | 9:00 - JST 1945 Aug 24
    9:00 - KST 1954 Mar 21 | 9:00 - KST 2015 Aug 15 00:00
    8:30 ROK K%sT 1961 Aug 10 | 8:30 - KST 2018 May 4 23:30
    9:00 ROK K%sT | 9:00 - KST
      eumiro 31

    View Slide

  65. Asia/Seoul, Asia/Pyongyang
    Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 | Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
    8:30 - KST 1912 Jan 1 | 8:30 - KST 1912 Jan 1
    9:00 - JST 1945 Sep 8 | 9:00 - JST 1945 Aug 24
    9:00 - KST 1954 Mar 21 | 9:00 - KST 2015 Aug 15 00:00
    8:30 ROK K%sT 1961 Aug 10 | 8:30 - KST 2018 May 4 23:30
    9:00 ROK K%sT | 9:00 - KST
    […] (2015-08-07) According to many news sources, North Korea is going to change to the 8:30 time
    zone on August 15
    […] (2015-08-15) Bells rang out midnight (00:00) Friday as part of the celebrations. […]
      eumiro 31

    View Slide

  66. Asia/Seoul, Asia/Pyongyang
    Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 | Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
    8:30 - KST 1912 Jan 1 | 8:30 - KST 1912 Jan 1
    9:00 - JST 1945 Sep 8 | 9:00 - JST 1945 Aug 24
    9:00 - KST 1954 Mar 21 | 9:00 - KST 2015 Aug 15 00:00
    8:30 ROK K%sT 1961 Aug 10 | 8:30 - KST 2018 May 4 23:30
    9:00 ROK K%sT | 9:00 - KST
    […] (2015-08-07) According to many news sources, North Korea is going to change to the 8:30 time
    zone on August 15
    […] (2015-08-15) Bells rang out midnight (00:00) Friday as part of the celebrations. […]
    […] (2018-04-29) North Korea will revert its time zone from UTC+8:30 (PYT; Pyongyang Time) back to
    UTC+9 (KST; Korea Standard Time).
    […] (2018-04-30) […] It appears to be the front page story at the top in the right-most column.
      eumiro 31

    View Slide

  67. tzdata2020f.tar.gz (2020-12-29, 402kB)
    3042 5. Okt 2018 CONTRIBUTING 182458 22. Dez 22:05 europe
    252 25. Mai 2017 LICENSE 404 17. Jun 2019 factory
    44015 23. Dez 20:21 Makefile 4463 20. Feb 2019 iso3166.tab
    186547 29. Dez 09:18 NEWS 10662 9. Jul 21:59 leap-seconds.list
    2424 19. Aug 05:47 README 3388 25. Okt 22:43 leapseconds
    69921 11. Dez 04:39 africa 8889 25. Okt 22:43 leapseconds.awk
    13743 4. Okt 00:07 antarctica 169355 5. Dez 19:39 northamerica
    177139 27. Okt 19:32 asia 88277 4. Okt 00:07 southamerica
    94449 5. Dez 19:32 australasia 60781 25. Nov 07:07 theory.html
    4680 25. Nov 00:40 backward 6 29. Dez 09:18 version
    26223 25. Nov 00:40 backzone 4188 23. Dez 20:21 ziguard.awk
    5567 2. Okt 2017 calendars 8347 3. Okt 23:58 zishrink.awk
    1008 2. Jun 2017 checklinks.awk 19321 2. Dez 05:52 zone.tab
    4473 22. Jun 2019 checktab.awk 17835 2. Dez 05:52 zone1970.tab
    2704 22. Okt 21:47 etcetera 1450 4. Okt 00:07 zoneinfo2tdf.pl
      eumiro 32

    View Slide

  68. Best practices
    don't invent your own time zones
      eumiro 33

    View Slide

  69. Best practices
    don't invent your own time zones
    don't hard code any rules
      eumiro 33

    View Slide

  70. Best practices
    don't invent your own time zones
    don't hard code any rules
    keep your time zone libs up-to-date
      eumiro 33

    View Slide

  71. Best practices
    don't invent your own time zones
    don't hard code any rules
    keep your time zone libs up-to-date
    follow your government's intentions to modify your time zone and inform [email protected]
      eumiro 33

    View Slide

  72. Best practices
    don't invent your own time zones
    don't hard code any rules
    keep your time zone libs up-to-date
    follow your government's intentions to modify your time zone and inform [email protected]
    AVOID TIME ZONES IF YOU CAN!
      eumiro 33

    View Slide

  73. Best practices
    don't invent your own time zones
    don't hard code any rules
    keep your time zone libs up-to-date
    follow your government's intentions to modify your time zone and inform [email protected]
    AVOID TIME ZONES IF YOU CAN!
    Miroslav Šedivý
      eumiro 33

    View Slide