mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Remove another instance of dateutil timezones
This commit is contained in:
parent
84ace57cc3
commit
bd259db94c
@ -11,7 +11,7 @@ import sqlite3 as sqlite, traceback, time, uuid, os
|
||||
from sqlite3 import IntegrityError, OperationalError
|
||||
from threading import Thread
|
||||
from threading import RLock
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from functools import partial
|
||||
|
||||
from calibre.ebooks.metadata import title_sort, author_to_author_sort
|
||||
@ -25,7 +25,6 @@ from polyglot.builtins import cmp, native_string_type
|
||||
from polyglot import reprlib
|
||||
from polyglot.queue import Queue
|
||||
|
||||
from dateutil.tz import tzoffset
|
||||
|
||||
global_lock = RLock()
|
||||
|
||||
@ -42,7 +41,7 @@ def _c_convert_timestamp(val):
|
||||
year, month, day, hour, minutes, seconds, tzsecs = ret
|
||||
try:
|
||||
return datetime(year, month, day, hour, minutes, seconds,
|
||||
tzinfo=tzoffset(None, tzsecs)).astimezone(local_tz)
|
||||
tzinfo=timezone(tzsecs)).astimezone(local_tz)
|
||||
except OverflowError:
|
||||
return UNDEFINED_DATE.astimezone(local_tz)
|
||||
|
||||
@ -61,7 +60,7 @@ def _py_convert_timestamp(val):
|
||||
min = int(val[14:16])
|
||||
sec = int(val[17:19])
|
||||
return datetime(year, month, day, hour, min, sec,
|
||||
tzinfo=tzoffset(None, tzsecs))
|
||||
tzinfo=timezone(tzsecs))
|
||||
except:
|
||||
pass
|
||||
return parse_date(val, as_utc=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user