search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

ISO-8601datetime nanoseconds support

Asked by RogerHR
1 year ago.

Hello, I got this error when using DayPilot

"DayPilot.Date - Unable to parse ISO8601 date/time string: 2022-06-01T23:59:59.999999999Z"

which is valid ISO8601 date time

can you confirm it's because nanoseconds parts are not supported ?
did you plan to support it at some point ?

Best regards

Answer posted by Dan Letecky [DayPilot]
1 year ago.

At this moment the DayPilot.Date class supports milliseconds only, i.e. it will accept three digits after the decimal point: "2022-06-01T23:59:59.999".

Milliseconds are the maximum precision that is used internally. Parsing a date string with nanoseconds would require rounding which doesn't produce the desired result ("2022-06-02T00:00:00").

However, the library is designed to work with exact time points that are not overlapping. So for a full-day event, you can use "2022-06-01T00:00:00" to "2022-06-02T00:00:00". Such event will not overlap with events starting at "2022-06-02T00:00:00".

For full-day events, you can also use the date part only mode (i.e. both start and end would be "2022-06-01"):

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.