This commit is contained in:
Kovid Goyal 2012-08-29 09:45:23 +05:30
parent 7e0ac417d7
commit 8c04dc14bd

View File

@ -6,6 +6,7 @@ __copyright__ = '2010, Timothy Legge <timlegge at gmail.com>'
import os
import time
from calibre.utils.date import parse_date
from calibre.devices.usbms.books import Book as Book_
class Book(Book_):
@ -30,6 +31,10 @@ class Book(Book_):
if ContentType == '6' and date is not None:
try:
self.datetime = time.strptime(date, "%Y-%m-%dT%H:%M:%S.%f")
except:
try:
self.datetime = parse_date(date,
assume_utc=True).timetuple()
except:
try:
self.datetime = time.gmtime(os.path.getctime(self.path))