diff --git a/src/calibre/manual/gui.rst b/src/calibre/manual/gui.rst index a4e18c2e07..e2758bc257 100644 --- a/src/calibre/manual/gui.rst +++ b/src/calibre/manual/gui.rst @@ -352,7 +352,7 @@ The syntax for searching for dates is:: If the date is ambiguous, the current locale is used for date comparison. For example, in an mm/dd/yyyy locale, 2/1/2009 is interpreted as 1 Feb 2009. In a dd/mm/yyyy locale, it is interpreted as 2 Jan 2009. Some special date strings are available. The string ``today`` translates to today's date, whatever it is. The -strings `yesterday`` and ``thismonth`` also work. In addition, the string ``daysago`` can be used to compare +strings ``yesterday`` and ``thismonth`` also work. In addition, the string ``daysago`` can be used to compare to a date some number of days ago, for example: date:>10daysago, date:<=45daysago. You can search for books that have a format of a certain size like this:: diff --git a/src/calibre/utils/zipfile.py b/src/calibre/utils/zipfile.py index e0f453452c..fa15bff4b4 100644 --- a/src/calibre/utils/zipfile.py +++ b/src/calibre/utils/zipfile.py @@ -1123,6 +1123,13 @@ class ZipFile: targetpath = os.sep.join(components) with open(targetpath, 'wb') as target: shutil.copyfileobj(source, target) + # Kovid: Try to preserve the timestamps in the ZIP file + try: + mtime = time.localtime() + mtime = time.mktime(member.date_time + (0, 0) + (mtime.tm_isdst,)) + os.utime(targetpath, (mtime, mtime)) + except: + pass self.extract_mapping[member.filename] = targetpath return targetpath