Skip to content

Commit b7914dd

Browse files
authored
Merge pull request #332 from pkkid/fix_276
fix datetime issue on windows.
2 parents fecfedb + bd8949e commit b7914dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plexapi/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ def toDatetime(value, format=None):
178178
if format:
179179
value = datetime.strptime(value, format)
180180
else:
181-
value = datetime.fromtimestamp(int(value))
181+
# https://bugs.python.org/issue30684
182+
# And platform support for before epoch seems to be flaky.
183+
value = datetime.datetime(1970, 1, 1) + datetime.fromtimestamp(milliseconds=value)
182184
return value
183185

184186

0 commit comments

Comments
 (0)