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

Make the date+time in the JSON report for "validatedAt" a standard format #1652

Closed
bradyhunsaker opened this issue Jan 19, 2024 · 3 comments · Fixed by #1691
Closed

Make the date+time in the JSON report for "validatedAt" a standard format #1652

bradyhunsaker opened this issue Jan 19, 2024 · 3 comments · Fixed by #1691
Assignees
Labels
enhancement New feature request or improvement on an existing feature status: Ready An issue that is ready to be worked on.

Comments

@bradyhunsaker
Copy link
Contributor

Describe the problem

The date+time for when validation is run uses a custom format, like "2024-01-15 at 23:14:46 EST". This is not a standard format and so is not easily machine readable.

It is put in two places: the JSON report as "validatedAt" and the HTML report in the first sentence.

Proposed solution

For the JSON report, it would be better to use a standard format, like ISO_ZONED_DATE_TIME: 2024-01-15T24:14:45+05:00[America/New_York]

Alternatives you've considered

It could be left as is. That makes it harder for anyone parsing the JSON report but doesn't break any existing parsers.

Additional context

This was noticed during review of issue #1292.

The main concern is that this would break any existing parsers of the validatedAt field in the JSON report.
My guess is that there are few if any such parsers and that a one-time break to use a standard format would be worthwhile.

The custom format is specified in the code here:

String date = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd 'at' HH:mm:ss z"));

@bradyhunsaker bradyhunsaker added enhancement New feature request or improvement on an existing feature status: Needs triage Applied to all new issues labels Jan 19, 2024
Copy link

welcome bot commented Jan 19, 2024

Thanks for opening your first issue in this project! If you haven't already, you can join our slack and join the #gtfs-validators channel to meet our awesome community. Come say hi 👋!

Welcome to the community and thank you for your engagement in open source! 🎉

@davidgamez
Copy link
Member

Tasks:

  • Investigate the proper Java classes to use.
  • Change the date format to ISO 8601 on JSON and HTML report, Example: 2024-01-15T24:14:45+05:00. Timestamp from JVM's timezone or parameter.
  • Review if there is any other code that uses Datetime format.

@emmambd emmambd added status: Ready An issue that is ready to be worked on. and removed status: Needs triage Applied to all new issues labels Mar 5, 2024
@qcdyx qcdyx self-assigned this Mar 6, 2024
@qcdyx
Copy link
Contributor

qcdyx commented Mar 6, 2024

  • I searched for java.util.Calendar and java.util.Date (the old java Data/Time class) - No results found.
  • I used DateTimeFormatter.ISO_DATE_TIME as the formatter. This will format the date and time as a string in the format yyyy-MM-dd'T'HH:mm:ss.SSSZ, which is the standard ISO 8601 format. For example, "2022-03-14T09:30:00.000Z".
    image

@emmambd emmambd removed this from the Now milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request or improvement on an existing feature status: Ready An issue that is ready to be worked on.
Projects
None yet
4 participants