diff --git a/ldclient/impl/model/value_parsing.py b/ldclient/impl/model/value_parsing.py index 8fb843a0..507be4f7 100644 --- a/ldclient/impl/model/value_parsing.py +++ b/ldclient/impl/model/value_parsing.py @@ -1,7 +1,7 @@ import re from re import Pattern from semver import VersionInfo -from datetime import tzinfo, timedelta, datetime +from datetime import tzinfo, timedelta, datetime, timezone from numbers import Number from typing import Any, Optional @@ -9,8 +9,8 @@ _ZERO = timedelta(0) -# A UTC class. +# A UTC class. class _UTC(tzinfo): """UTC""" @@ -23,7 +23,8 @@ def tzname(self, dt): def dst(self, dt): return _ZERO -_epoch = datetime.utcfromtimestamp(0).replace(tzinfo=_UTC()) + +_epoch = datetime.fromtimestamp(0, timezone.utc) def is_number(input: Any) -> bool: