Skip to content

datetime_to_fakedatetime function ignores fold parameter #422

@alexander-doroshenko

Description

@alexander-doroshenko

since python 3.6 version to datetime class was added fold argument to disambiguate the times during a repeated interval.

An example of where it can hurt :

from datetime import timezone, datetime
from freezegun import api

d = datetime(2021, 10, 30, 23, tzinfo=timezone.utc)
fd = api.FakeDatetime(2021, 10, 30, 23, tzinfo=timezone.utc)
isr = tz.gettz('Israel')
d.astimezone(isr).dst() == fd.astimezone(isr).dst()
>> False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions