Skip to content

Add :date_time_current_year_with_seconds date/time format - #592

Open
SimonSiju wants to merge 1 commit into
Shopify:mainfrom
SimonSiju:simonsiju/date-at-time-with-seconds-format
Open

SimonSiju wants to merge 1 commit into
Shopify:mainfrom
SimonSiju:simonsiju/date-at-time-with-seconds-format

Conversation

@SimonSiju

@SimonSiju SimonSiju commented Sep 9, 2026

Copy link
Copy Markdown

What

Adds :date_time_current_year_with_seconds:date_time_current_year (a compact, year-omitted "MMM d + time" timestamp) with the time upgraded to second precision.

It exists for cross-system log/event correlation, where the exact second matters. Like the base format, each locale owns the field order, separators, and 12h/24h clock — nothing is forced:

locale renders
en Dec 26, 1:23:45 pm (12-hour)
fr 26 déc. 13:23:45 (24-hour, day-first)
vi 13:23:45, 26 Thg 12 (time-first)
da 26. dec. 13.23.45 (. separators)
ja 12月26日 13:23:45
ko 12월 26일 오후 1:23:45

How

  • One entry in DATETIME_FORMAT_MAP: the locale's datetime.short combiner + MMMd + time.medium (the seconds-bearing, locale-clock time format).
  • Regenerated data/other/generated/*.yml (805 locales) + formats.md — reproducible via the CLDR rake task (bin/test-cldr-rake-tasks re-runs it and fails on any diff).
  • Test: representative locales + an all-locales guard asserting each locale's pattern carries a seconds field.

Notes (review feedback addressed)

  • Named for what it is — it's date_time_current_year + seconds, not date_at_time + seconds; the name reflects that so it doesn't need a breaking rename later.
  • Uses each locale's own clock (time.medium) rather than forcing 24h everywhere.
  • Year is omitted, matching date_time_current_year. The consuming surface (Dev Dashboard app-logs) shows recent logs and pins the exact instant via its local + UTC hover tooltip.
  • Only 3 hand-written files (generator, test, CHANGELOG); everything under data/other/generated/ is generated.

Consuming change: Dev Dashboard app-logs timestamps (shop/issues-develop#23821).

@SimonSiju
SimonSiju force-pushed the simonsiju/date-at-time-with-seconds-format branch from f482577 to e7456b5 Compare September 9, 2026 19:58
@SimonSiju
SimonSiju marked this pull request as draft September 11, 2026 19:43
:date_time_current_year with the time upgraded to second precision, for
cross-system log/event correlation where the exact second matters. Each locale
keeps its own field order, separators, and 12h/24h clock:
  en  Dec 26, 1:23:45 pm    (12-hour)
  fr  26 déc. 13:23:45      (24-hour, day-first)
  vi  13:23:45, 26 Thg 12   (time-first)
  da  26. dec. 13.23.45     ('.' separators)

- Add to DATETIME_FORMAT_MAP (datetime.short combiner + MMMd + time.medium)
  in the CLDR locale generator
- Regenerate data/other/generated/*.yml and formats.md
- Add a rendering test (representative locales + an all-locales seconds guard)

Assisted-By: devx/aa33f4dc-e917-41af-9b6c-83e935289511
@SimonSiju
SimonSiju force-pushed the simonsiju/date-at-time-with-seconds-format branch from e7456b5 to b22a997 Compare September 14, 2026 18:49
@SimonSiju SimonSiju changed the title Add :date_at_time_with_seconds date/time format Add :date_time_current_year_with_seconds date/time format Sep 14, 2026
@SimonSiju
SimonSiju marked this pull request as ready for review September 14, 2026 18:50

@najibna najibna left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reusing date_time_current_year with time.medium is the right approach, and the all-locales %S assertion is a good guard.

Nit: the changelog entry is longer than the rest of this file. The first sentence is enough.

This branch has not been deployed

No deployments
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 this pull request may close these issues.

2 participants