mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
7e0ac417d7
commit
8c04dc14bd
@ -6,6 +6,7 @@ __copyright__ = '2010, Timothy Legge <timlegge at gmail.com>'
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
from calibre.utils.date import parse_date
|
||||||
from calibre.devices.usbms.books import Book as Book_
|
from calibre.devices.usbms.books import Book as Book_
|
||||||
|
|
||||||
class Book(Book_):
|
class Book(Book_):
|
||||||
@ -32,9 +33,13 @@ class Book(Book_):
|
|||||||
self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f")
|
self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f")
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
self.datetime = time.gmtime(os.path.getctime(self.path))
|
self.datetime = parse_date(date,
|
||||||
|
assume_utc=True).timetuple()
|
||||||
except:
|
except:
|
||||||
self.datetime = time.gmtime()
|
try:
|
||||||
|
self.datetime = time.gmtime(os.path.getctime(self.path))
|
||||||
|
except:
|
||||||
|
self.datetime = time.gmtime()
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.datetime = time.gmtime(os.path.getctime(self.path))
|
self.datetime = time.gmtime(os.path.getctime(self.path))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user