mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
ad117486c1
commit
0d90ff04d3
@ -72,7 +72,7 @@ def qt_to_dt(qdate_or_qdatetime, as_utc=True):
|
|||||||
return dt.astimezone(_utc_tz if as_utc else _local_tz)
|
return dt.astimezone(_utc_tz if as_utc else _local_tz)
|
||||||
|
|
||||||
def fromtimestamp(ctime, as_utc=True):
|
def fromtimestamp(ctime, as_utc=True):
|
||||||
dt = datetime.utcfromtimestamp().replace(tzinfo=_utc_tz)
|
dt = datetime.utcfromtimestamp(ctime).replace(tzinfo=_utc_tz)
|
||||||
if not as_utc:
|
if not as_utc:
|
||||||
dt = dt.astimezone(_local_tz)
|
dt = dt.astimezone(_local_tz)
|
||||||
return dt
|
return dt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user