From 7905b2e4ef0f3d64822abbd0ba1d2688bad6292b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 3 Sep 2013 12:16:43 +0530 Subject: [PATCH] Serialize dates in local tz in csv/xml catalogs --- src/calibre/library/catalogs/csv_xml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/catalogs/csv_xml.py b/src/calibre/library/catalogs/csv_xml.py index c594a346d4..702bde3b1e 100644 --- a/src/calibre/library/catalogs/csv_xml.py +++ b/src/calibre/library/catalogs/csv_xml.py @@ -136,7 +136,7 @@ class CSV_XML(CatalogPlugin): # Could be 9, 10 or 13 digits, with hyphens, possibly ending in 'X' item = u'%s' % re.sub(r'[^\dX-]', '', item) elif field in ['pubdate', 'timestamp']: - item = isoformat(item) + item = isoformat(item, as_utc=False) elif field == 'comments': item = item.replace(u'\r\n', u' ') item = item.replace(u'\n', u' ') @@ -198,7 +198,7 @@ class CSV_XML(CatalogPlugin): for field in ('timestamp', 'pubdate'): if field in fields: - record.append(getattr(E, field)(r[field].isoformat())) + record.append(getattr(E, field)(isoformat(r[field], as_utc=False))) if 'tags' in fields and r['tags']: tags = E.tags()