I am trying to parse string "2023-05-10 09:41:00" to LocalTime using java.time library.
When I try LocalTime.parse("2023-05-10 09:41:00", DateTimeFormatter.ISO_LOCAL_DATE_TIME)
I get java.time.format.DateTimeParseException
. However when I try LocalTime.parse("2023-05-10T09:41:00", DateTimeFormatter.ISO_LOCAL_DATE_TIME)
it works.
Is there any DateTimeFormatter
constant I can use that works without the "T" separator? I am aware I can use a custom DateTimeFormatter but I would like to use a prepackaged constant from java or kotlin library like pseudo code DateTimeFormatter.ISO_LOCAL_DATE_TIME_WIHOUT_T
.