Skip to content

DeprecationWarning: datetime.utcfromtimestamp() is deprecated #1284

@hugovk

Description

@hugovk

With a self-built version of Python 3.12 that includes python/cpython#103857:

Python 3.12.0a7+ (heads/main-dirty:c527eb1c2a, May 15 2023, 10:39:28) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil.tz
/private/tmp/dateutil/src/dateutil/tz/tz.py:37: DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).
  EPOCH = datetime.datetime.utcfromtimestamp(0)
>>>

That warning again:

DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).

This is from:

EPOCH = datetime.datetime.utcfromtimestamp(0)

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