Skip to content

DST bug? #191

@petrprikryl

Description

@petrprikryl

I found strange outputs. I suspect that this is due DST because the DST shift will be in 2025-10-26.

from zoneinfo import ZoneInfo
from datetime import datetime

prague = ZoneInfo(key='Europe/Prague')
now = datetime(year=2025, month=10, day=19, hour=12, minute=0, second=0, tzinfo=prague)

c = croniter("10 3 * * 0", now)
c.get_prev(datetime)
>>> Out[34]: datetime.datetime(2025, 10, 19, 3, 10, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague'))
c.get_next(datetime)
>>> Out[35]: datetime.datetime(2025, 10, 26, 4, 10, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague'))
# Here I would expect 2025-10-19 as interval is 1 week, not 1 hour
c.get_prev(datetime)
>>> Out[36]: datetime.datetime(2025, 10, 26, 3, 10, tzinfo=zoneinfo.ZoneInfo(key='Europe/Prague'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions