This piece of code is working fine on my old computer. However, once I moved it to this computer , i received this exception. I looked into the possible answers from other posts, i.e. adding Locale.US
do not work.
Basically,
Locale locale = new Locale("en", "US");
DateTimeFormatter dtformatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS",locale);
LocalTime time = LocalTime.parse("20190502050634678",dtformatter);
Exception in thread "main" java.time.format.DateTimeParseException: Text '20190502050634678' could not be parsed at index 0
at java.time.format.DateTimeFormatter.parseResolved0(Unknown Source)
at java.time.format.DateTimeFormatter.parse(Unknown Source)
at java.time.LocalTime.parse(Unknown Source)
I am not sure how do I overcome this ? I removed Locale
and that do not work either.