fix date(1) based timestamp parser

This commit is contained in:
Johannes Schauer Marin Rodrigues 2023-06-11 07:48:23 +02:00
parent 79e9985f35
commit c703e9df06
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -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)