Closed dongli closed 1 year ago
When I fed strptime with a wrong time string, it just returns a normal result, but I expect an error report:
strptime
type(datetime) time time = strptime('', '%Y-%m-%dT%H:%M:%SZ') print *, time%isoformat() => 1900-01-00T00:00:00.000 time = strptime('XXX', '%Y-%m-%dT%H:%M:%SZ') print *, time%isoformat() => 1900-01-00T00:00:00.000 time = strptime('2017-01-0 15:30:00Z', '%Y-%m-%dT%H:%M:%SZ') print *, time%isoformat() => 2017-01-00T00:00:00.000 ...
Maybe it could set some field of datetime to indicate an invalid status? Say:
datetime
time = strptime('XXX', '%Y-%m-%dT%H:%M:%SZ') if (time%invalid) then ... end if
Yes. I at least added a warning to strftime. Would be want datetime-fortran to "error stop" or just emit a stderr warning for strftime and strptime failures?
When I fed
strptime
with a wrong time string, it just returns a normal result, but I expect an error report:Maybe it could set some field of
datetime
to indicate an invalid status? Say: