From c703e9df06aa863a29f14f43578366403f2d59c6 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 11 Jun 2023 07:48:23 +0200 Subject: [PATCH] fix date(1) based timestamp parser --- src/img2pdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index fa2aa73..cc30e7c 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -3051,7 +3051,7 @@ def valid_date(string): else: try: return parser.parse(string) - except TypeError: + except: pass # as a last resort, try the local date utility try: @@ -3064,7 +3064,7 @@ def valid_date(string): except subprocess.CalledProcessError: pass else: - return datetime.utcfromtimestamp(int(utime)) + return datetime.fromtimestamp(int(utime)) raise argparse.ArgumentTypeError("cannot parse date: %s" % string)