From d2677fc1bb1bc83251e42a1bce5f78f922add53e Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 10 Jun 2010 17:21:17 +0100 Subject: [PATCH] Fixup date on windows in sony driver --- src/calibre/devices/prs505/sony_cache.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index 5542e28d90..413d6959a6 100644 --- a/src/calibre/devices/prs505/sony_cache.py +++ b/src/calibre/devices/prs505/sony_cache.py @@ -12,7 +12,7 @@ from uuid import uuid4 from lxml import etree -from calibre import prints, guess_type +from calibre import prints, guess_type, iswindows from calibre.devices.errors import DeviceError from calibre.devices.usbms.driver import debug_print from calibre.constants import DEBUG @@ -423,7 +423,10 @@ class XMLCache(object): return ans def update_text_record(self, record, book, path, bl_index): - timestamp = os.path.getctime(path) + timestamp = os.path.getmtime(path) + # Correct for MS DST time 'adjustment' + if iswindows and time.daylight: + timestamp -= time.altzone - time.timezone date = strftime(timestamp) if date != record.get('date', None): record.set('date', date)