A DESCRIPTION OF THE PROBLEM : As already mention in this Question in StackOveflow https://stackoverflow.com/questions/49967139/java-datetimeformatter-fail-to-parse-time-string-when-seconds-and-milliseconds This piece of code should return for this "20180301091600000" with this "yyyyMMddHHmmssSSS" patter a result : "2018-03-01T09:16:00.000" note the last part "00.000" for seconds and milliseconds. Instead it return "2018-03-01T09:16". REGRESSION : Last worked in version 10.0.1 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : DateTimeFormatter dtformatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS"); var result = LocalDateTime.parse("20180301091600000", dtformatter); System.out.println(result); EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - 2018-03-01T09:16:00.000 ACTUAL - 2018-03-01T09:16 CUSTOMER SUBMITTED WORKAROUND : A temporary solution is like I mentioned here https://stackoverflow.com/a/49967274/5558072 We need to parse the date with another formatter like this : var result = LocalDateTime.parse("20180301091600001", dtformatter) .format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss:SSS")); FREQUENCY : always
|