Forum Discussion
Sure. It is actually the same date in my reply. It only fails because it returns NaN. The weird about it is that I have a similar job running the same way and it does not fail.
Date.parse(“2021-03-14 02:40:18.000”,“yyyy-MM-dd HH:mm:ss”+“.000”) - the difference is the .000 at the end.
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)
- tlikarish5 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