Dates: Strict parsing (DateFormat)

Hi there,

is it possible to have the parsing of the specified DateFormat strict ?

I don’t want to have a string like “1:2” parsed as Time when explicitly specifying dateformat"HH:MM:SS".

Time("1:2",dateformat"HH:MM:SS")

In my case “1:2” is a ration :wink:
You might ask why I am trying to parse a Time when I now it’s a ratio. Well .. I don’t know it in advance … I try to guess the type of the fields in unknow datasets. I partly use Parsers for that purpose, but it handles the above string the same.

Parsers.parse(Time,"1:2")

Moreover filling in missing fields carries the risk of feigning too high an accuracy.
I think ISO8601 says that “01:02” (as point in time) means a minute and not a second like “01:02:00” does.

What do you think?

Greetings
Paracetamol

1 Like

Link to related thread.

1 Like