Correct Date Format for Millis Precision

What is the correct format for Millis that works in system.date.parse()?
When doing this

date = system.date.parse('2022-01-27 14:22:58.3390','yyyy-MM-dd HH:mm:ss.SSSS')
system.date.format(date,'yyyy-MM-dd HH:mm:ss.SSSS')

The console shows u'2022-01-27 14:23:01.0390' but it should be u'2022-01-27 14:22:58.3390'

Only use three capital 'S’s.

1 Like

Same result, :pensive:

You cant have 3390 milliseconds since that would be 3 seconds and 390ms

2 Likes

Millis are thousandths of a second. java.util.Date doesn’t have nanosecond precision, if you need more.
https://docs.oracle.com/javase/8/docs/api/java/util/Date.html

1 Like

Right, I have that in my mind but the historian got me hehe
image

Useful, thanks.
That 0 at the end confused me ( :face_with_thermometer: 3rd dose - dizzy)

2 Likes