Skip to content

datetime.utcnow() and datetime.now() return same value #506

@HimanshuVijay-Heyday

Description

@HimanshuVijay-Heyday

I am not in UTC timezone.

Normally:

>>> datetime.utcnow().timestamp() - datetime.now().timestamp()
25199.999709129333

with freeze_time:

>>> with freeze_time('2012-01-14'):
...     datetime.utcnow().timestamp() - datetime.now().timestamp()
... 
0.0

Isn't this wrong ?! freeze_time should preserve the timezone offset.

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