From 70b2ab02938df8f7c71a635510c73919fd4e8ead Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Jun 2010 01:45:11 +0530 Subject: [PATCH] SONY driver: Correct fix for timestamp handling (I hope) --- src/calibre/devices/prs505/sony_cache.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index fa4dd74b6d..727bdf68b2 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, iswindows, islinux +from calibre import prints, guess_type from calibre.devices.errors import DeviceError from calibre.devices.usbms.driver import debug_print from calibre.constants import DEBUG @@ -47,10 +47,7 @@ def strptime(src): src[2] = str(MONTH_MAP[src[2]]) return time.strptime(' '.join(src), '%w, %d %m %Y %H:%M:%S %Z') -def strftime(epoch, zone=None): - zone = time.gmtime - if islinux: - zone = time.localtime +def strftime(epoch, zone=time.localtime): src = time.strftime("%w, %d %m %Y %H:%M:%S GMT", zone(epoch)).split() src[0] = INVERSE_DAY_MAP[int(src[0][:-1])]+',' src[2] = INVERSE_MONTH_MAP[int(src[2])] @@ -427,9 +424,6 @@ class XMLCache(object): def update_text_record(self, record, book, path, bl_index): 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)