From 67722fca23b3dee4203e685575953e230afef887 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 Sep 2010 10:56:19 -0600 Subject: [PATCH] Fix #7002 (Support for dates before 1900) --- src/calibre/ebooks/epub/fix/epubcheck.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/epub/fix/epubcheck.py b/src/calibre/ebooks/epub/fix/epubcheck.py index fd913a654b..81f4ce4d80 100644 --- a/src/calibre/ebooks/epub/fix/epubcheck.py +++ b/src/calibre/ebooks/epub/fix/epubcheck.py @@ -43,7 +43,11 @@ class Epubcheck(ePubFixer): default=default) except: raise InvalidEpub('Invalid date set in OPF', raw) - sval = ts.strftime('%Y-%m-%d') + try: + sval = ts.strftime('%Y-%m-%d') + except: + from calibre import strftime + sval = strftime('%Y-%m-%d', ts.timetuple()) if sval != raw: self.log.error( 'OPF contains date', raw, 'that epubcheck does not like')