Closed rjb4standards closed 3 years ago
Nevermind, it is clearly supported in spdx 2.2 but the online validation tool throws an exception on a valid iso 8601 UTC date. Sorry for not catching this sooner. RTFM, when in doubt.
From looking at the code, it looks like the problem is .680092
following the seconds.
In the spec, the format is stated as ISO 8601, but the data format is specified to only include up to the seconds.
I took a look at the Wikipedia page for ISO 8601 and could not find a reference for the sub-second format. @rjb4standards do you know if ISO 8601 supports this? If so, we should update both the spec and the tools.
In the interim, removing the .680092
should work around the issue.
Thanks Gary: Looking at RFC 3339, which applies iso 8601, it appears the fractional component of time can be any number of digits; here's the BNF: from https://www.ietf.org/rfc/rfc3339.txt
5.6. Internet Date/Time Format
The following profile of ISO 8601 [ISO8601] dates SHOULD be used in new protocols on the Internet. This is specified using the syntax description notation defined in [ABNF].
date-fullyear = 4DIGIT date-month = 2DIGIT ; 01-12 date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on ; month/year time-hour = 2DIGIT ; 00-23 time-minute = 2DIGIT ; 00-59 time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second ; rules *time-secfrac = "." 1DIGIT** time-numoffset = ("+" / "-") time-hour ":" time-minute time-offset = "Z" / time-numoffset
partial-time = time-hour ":" time-minute ":" time-second [time-secfrac] full-date = date-fullyear "-" date-month "-" date-mday full-time = partial-time time-offset
date-time = full-date "T" full-time
I'll truncate to seconds - thanks for your help.
Truncating at seconds solved the problem. Thanks Gary.
This has been fixed in the SPDX Java Library used by the online tools. Once the library is release, we can update the SPDX online tools to use the new version of the library to resolve this issue.
I added an issue to the SPDX spec to track the inconsistency.
I think fractional seconds should NOT be supported, since the spec clearly says the format is YYYY-MM-DDThh:mm:ssZ
.
We should fix the wording to not imply that everything described in ISO=8601 is allowed. No Julian dates, no week dates, none of the extended parts (unknown/unspecified numbers, spring/summer/etc.), ...
I can live with that change, this is how I'm doing it now: Created: 2021-03-17T14:18:27Z
I'm going to go ahead and close this issue since a related spec issue has been opened.
I'm receiving an error Analysis exception processing SPDX file: Invalid date format: Unparseable date: "2021-03-14T14:33:03.680092Z" on Tag/Value Created: 2021-03-14T14:33:03.680092Z
Is ISO 8601 date/time format supported in spdx 2.2?
Thanks..