How to parse this date/time in Java/Kotlin?
I have this NMEA timestamp: 120722202122 and I want to parse it.
I tried
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
fun main() {
println(LocalDateTime.parse("120722202122", DateTimeFormatter.ofPattern("DDMMyyHHmmss")))
}
Playground
but I get an Exception:
Conflict found: Field MonthOfYear 1 differs from MonthOfYear 7 derived from 2022-01-12
I don't know what the Exception wants to tell...