File tree 1 file changed +14
-6
lines changed
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -295,15 +295,23 @@ end
295
295
296
296
_DEFAULT_TYPE_MAP[:time ] = Time
297
297
function pqparse (:: Type{Time} , str:: AbstractString )
298
- result = nothing
299
- try
298
+ @static if v " 1.6.6" <= VERSION < v " 1.7.0" || VERSION >= " 1.7.2"
300
299
result = tryparse (Time, str)
301
- catch err
302
- if ! (err isa InexactError)
303
- rethrow (err)
300
+ if isnothing (result)
301
+ # If there's an error we want to see it here
302
+ result = parse (Time, _trunc_seconds (str))
303
+ end
304
+ return result
305
+ else
306
+ try
307
+ return parse (Time, str)
308
+ catch err
309
+ if ! (err isa InexactError)
310
+ rethrow (err)
311
+ end
312
+ return parse (Time, _trunc_seconds (str))
304
313
end
305
314
end
306
- return isnothing (result) ? parse (Time, _trunc_seconds (str)) : result
307
315
end
308
316
309
317
# InfExtendedTime support for Dates.TimeType
You can’t perform that action at this time.
0 commit comments