You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using this I noticed all milliseconds in dates get discarded and effectively set to 0.
You can see this in the moment format used, which has only seconds precision:
functionformatMoment(m){returnstring(m.utc().format('YYYY-MM-DD HH:mm:ss'),false)+'::timestamp with time zone';}functionformatDate(date){returnformatMoment(moment(date));}
If I'm reading the moment docs correctly, getting to the desired format should be as simple as appending .SSS after the seconds:
'YYYY-MM-DD HH:mm:ss.SSS'
I don't know how actively maintained this library is. Any hope of this getting fixed and published?
I'd be happy to attempt a fix PR if it's likely to be accepted.
Thanks for giving this some consideration.
Cheers,
Chris
The text was updated successfully, but these errors were encountered:
chriscalo
changed the title
Dates discard millisecond precision
Formatted dates lose millisecond precision
May 18, 2022
When using this I noticed all milliseconds in dates get discarded and effectively set to 0.
You can see this in the moment format used, which has only seconds precision:
If I'm reading the moment docs correctly, getting to the desired format should be as simple as appending
.SSS
after the seconds:'YYYY-MM-DD HH:mm:ss.SSS'
I don't know how actively maintained this library is. Any hope of this getting fixed and published?
I'd be happy to attempt a fix PR if it's likely to be accepted.
Thanks for giving this some consideration.
Cheers,
Chris
The text was updated successfully, but these errors were encountered: