I'm trying to parse lets say "2020-01-12+01:00"
with JSR-310 time.
I read it via DateTimeFormatter.ofPattern("yyyy-MM-ddVV")
, however now if I want to transform that into a Instant via Instant.from(DateTimeFormatter.ofPattern("yyyy-MM-ddVV").parse("...")
, it throws where it complains that time
is null.
Which granted it is, but, I'd like to get Instant from that, i.e. epochMillis, so I can serialize the long
into a database.
Is there a way around it? Basically I'd like to extend the "2020-01-12+01:00"
to "2020-01-12T00:00.000+01:00"
and parse that to Instant as usual