Skip to content

Commit 6c58e82

Browse files
committed
Replace deprecated datetime.utcfromtimestamp() with timezone-aware alternative
1 parent b3b2e1d commit 6c58e82

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: scrapinghub/hubstorage/serialization.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import six
1+
from datetime import UTC, datetime
22
from json import dumps, loads
3-
from datetime import datetime
43

5-
EPOCH = datetime.utcfromtimestamp(0)
4+
import six
5+
6+
EPOCH = datetime.fromtimestamp(0, UTC)
67
ADAYINSECONDS = 24 * 3600
78

89

910
try:
1011
from msgpack import Unpacker
12+
1113
MSGPACK_AVAILABLE = True
1214
except ImportError:
1315
MSGPACK_AVAILABLE = False

0 commit comments

Comments
 (0)