Define a standard for Date formats

Created on 13 August 2024, 8 months ago
Updated 20 August 2024, 8 months ago

Problem/Motivation

As far as I can tell, there is no standard for date formats on drupal.org.

Some date formats in Drupal core were using the US format, for example the Default medium date for 7th of August:

Wed, 08/07/2024 - 11:24

The date format for Drupal core was recently updated in 📌 Use easily recognizable date format RTBC (Change record: Default date formats have changed ) to use the date format "12 August 2024" as recommended by these resources:

It would be nice to standardize on an easily understandable format, such as "7 Aug 2024", which is already used on drupal.org, as can be see in issue dates under "Created".

Benefits

If we adopted this change, the Drupal Project would benefit by having a universally and easily recognizable date format, and contrib module maintainers and Drupal core developers would know which date format to use.

Three supporters required

  1. https://www.drupal.org/u/ {userid} (yyyy-mm-dd they added support)
  2. https://www.drupal.org/u/ {userid} (yyyy-mm-dd they added support)
  3. https://www.drupal.org/u/ {userid} (yyyy-mm-dd they added support)

Proposed changes

I have created a documentation page Date formats under "Develop > Creating modules" which could be revised until it's acceptable, and eventually be moved to https://www.drupal.org/docs/develop/standards . This is the suggested standard:

Human readable date formats

It is recommended to use British English standard for human readable date formats, since it is used by most of the world, and easily understandable.

  • 6 Aug 2019
  • 6 August 2019
  • Wednesday, 6 August 2019

For more, see:

Dates represented by numbers

When dates are represented with numbers they can be interpreted in different ways. ISO 8601 tackles this uncertainty by setting out an internationally agreed way to represent dates this way:

YYYY-MM-DD resulting in "2023-02-23"

ISO 8601 Date and time format.

Remaining tasks

  1. Add supporters
  2. Create a Change Record
  3. Review by the Coding Standards Committee
  4. Coding Standards Committee takes action as required
  5. Discussed by the Core Committer Committee, if it impacts Drupal Core
  6. Final review by Coding Standards Committee
  7. Documentation updates
    1. Edit all pages
    2. Publish change record
    3. Remove 'Needs documentation edits' tag
  8. If applicable, create follow-up issues for PHPCS rules/sniffs changes

For a full explanation of these steps see the Coding Standards project page

📌 Task
Status

Active

Component

Coding Standards

Created by

🇩🇰Denmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024