forked from josch/img2pdf
fix date(1) based timestamp parser
This commit is contained in:
parent
79e9985f35
commit
c703e9df06
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue