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

Date and time patterns should follow DateTimeFormatter #1416

Closed
ppkarwasz opened this issue Apr 8, 2023 · 3 comments
Closed

Date and time patterns should follow DateTimeFormatter #1416

ppkarwasz opened this issue Apr 8, 2023 · 3 comments
Labels
enhancement Additions or updates to features

Comments

@ppkarwasz
Copy link
Contributor

ppkarwasz commented Apr 8, 2023

In release 2.x date time patterns follow SimpleDateFormat with additional extensions provided by FastDateFormat and support for the n specifier for nanoseconds.

The exception is JSON Template Layout, which uses the format specifiers from DateTimeFormatter.

In release 3.x we should switch all format specifiers to those documented DateTimeFormatter.

The major differences are:

  • u means day-of-week in SDF and era in DTF,
  • SDF lacks L meaning month as text,
  • SDF lacks q and Q as quarter,
  • in DTF Z, ZZ and ZZZ all mean the same format for the time zone (e.g. -0800, +0000). In SDF (Commons Land version) ZZ uses the ISO 8601 format with a colon (e.g. -08:00, Z) and ZZZ adds a colon to the original Z format (e.g. -08:00, +00:00).
@ppkarwasz ppkarwasz added the enhancement Additions or updates to features label Apr 8, 2023
@ppkarwasz ppkarwasz added this to the 3.0.0 milestone Apr 8, 2023
@vy
Copy link
Member

vy commented Apr 10, 2023

Even though this will be a (slightly?) breaking change, can't we rather implement this (breaking change) in 2.x and introduce a property to restore the old behaviour? As long as we clearly indicate this in release notes, this feels legit to me. @rgoers, WDYT?

@garydgregory
Copy link
Member

SDT -> SDF?

@ppkarwasz
Copy link
Contributor Author

Fixed by #3150.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additions or updates to features
Projects
None yet
Development

No branches or pull requests

3 participants