[Python] PYTZ python is incorrectly adjusting for daylight saving on timezone Mexico_City

Discussão em 'Python' iniciado por Stack, Abril 8, 2025.

  1. Stack

    Stack Membro Participativo

    is PYTZ **incorrectly ** observing daylight saving for timezone Mexico_City ?

    I think daylight saving is no longer observed in Mexico asper this article:

    https://time.is/time_zone_news/changes_in_mexico_time_zones

    tz = timezone("America/New_York")
    d=datetime(2023, 7, 7, 12, 0)
    dt = tz.localize(d)
    mx = timezone("America/Mexico_City")
    dtmx = dt.astimezone(mx)
    dtmx


    gives result:

    '2023-07-07T10:42:26.546648-05:00'

    whereas the expectation is:

    '2023-07-07T9:42:26.546648-05:00'

    Continue reading...

Compartilhe esta Página