Conversion Problem with From and To ISO8601 Datetime

Hello there!

I came up with a problem converting JulianDate to and from ISO8601, using the members of the new Cesium.JulianDate(julianDayNumber, secondsOfDay, timeStandard) object.

Specifically, when the accuracy of the fractional part of secondsOfDay is higher than 1e-7 (i.e. it has more than 7 digits), the Cesium.JulianDate.toIso8601() function returns a string that is unacceptable by Cesium.JulianDate.fromIso8601().

I attach a piece of code to showcase the problem (currTime_Iso8601 is an unacceptable input at the 3rd line):

const currTime = new Cesium.JulianDate(2460391, 1e-8);
const currTime_Iso8601 = Cesium.JulianDate.toIso8601(currTime);
const currTimeNew = Cesium.JulianDate.fromIso8601(currTime_Iso8601);

Here is a sandcastle example

I think that this issue, although not critical, it should be corrected by the Cesium developers.

Best,
Nikos

Hi @tikhonov, thanks for the Sandcastle–it’s a very clear confirmation of the bug!

There is already an issue open for this at JulianDate.toIso8601 builds a non compliant string with very small milliseconds · Issue #11507 · CesiumGS/cesium · GitHub. I added your Sandcastle to the discussion. Feel free to add any more details there.