Forum Discussion
tlikarish
5 years agoEmployee
So the format string should include the milliseconds or the parse fails with NaN
.
Could you try this format with the milliseconds on the end?
Date.parse("2021-03-14 02:40:18.000", "yyyy-MM-dd HH:mm:ss.SSS")
Here’s a pipeline to play around with the two different parse examples.
date-parse-example_2021_03_16.slp (2.3 KB)
tlikarish
5 years agoEmployee
For more examples of formatting, check out the SimpleDateFormat documentation. There are some examples on there that I’ve found helpful.
https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html