Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMESTAMP_FORMAT should not use ZZZZ for tenths of milliseconds #965

Closed
ElectricNroff opened this issue Dec 19, 2022 · 2 comments · Fixed by #971
Closed

TIMESTAMP_FORMAT should not use ZZZZ for tenths of milliseconds #965

ElectricNroff opened this issue Dec 19, 2022 · 2 comments · Fixed by #971
Assignees

Comments

@ElectricNroff
Copy link
Contributor

TIMESTAMP_FORMAT: 'Bad date, or invalid timestamp format: valid format is yyyy-MM-ddTHH:mm:ss or yyyy-MM-ddTHH:mm:ss.ZZZZ'

is potentially confusing because the letters ZZZZ are not ordinarily used to denote fractions of a second, and the reader may be misled into thinking that this is the "time zone" syntax ('Z' for "zone"). Also, ZZZZ is confusing because sub-second time precision is ordinarily either milliseconds (three digits after the dot) or microseconds (six digits after the dot), and hardly ever tenths of milliseconds (four digits after the dot).

RFC3339 refers to the part after mm:ss as time-secfrac, and thus .FFF could be used ('F' for "fraction").

A typical time would be one of these:

  1. 2023-01-01T12:34:56.789
  2. 2023-01-01T12:34:56.789Z
  3. 2023-01-01T12:34:56.789-05:00

where option 1 is discouraged because it is not allowed by RFC3339 and is, more or less, a bespoke syntax for the CVE JSON 5.0 schema.

It could be reworded in multiple ways, possibly including:

OLD: valid format is yyyy-MM-ddTHH:mm:ss or yyyy-MM-ddTHH:mm:ss.ZZZZ
NEW: example valid formats are yyyy-MM-ddTHH:mm:ssZ or yyyy-MM-ddTHH:mm:ss.fff-zh:zm
@slubar
Copy link
Contributor

slubar commented Dec 20, 2022

@ElectricNroff this is the format used in the JSON 5.0 schema

@slubar
Copy link
Contributor

slubar commented Dec 21, 2022

On line 5 of the errorMessages.js file mentioned above, change 'yyyy-MM-ddTHH:mm:ss.ZZZZ' to 'yyyy-MM-ddTHH:mm:ssZZZZ' to remove the dot between ss and ZZZZ

@slubar slubar self-assigned this Dec 21, 2022
@slubar slubar linked a pull request Dec 21, 2022 that will close this issue
jdaigneau5 added a commit that referenced this issue Dec 21, 2022
#965 fix typo in error message about timestamp format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants