Date format change reset after Drupal database update

Created on 6 December 2024, 16 days ago

Problem/Motivation

We have changed the date format for our customer Drupal from "Y-m-d H:i:s" to "Y-m-d". However, as soon as we deploy a new version of Drupal and update the database using update.php, the date format is reset.

Steps to reproduce

Install standard Drupal (e.g. 10.3.8).
Change the date format from "Y-m-d H:i:s" to ""Y-m-d".
Update Drupal to the latest version (e.g. 10.3.10).
Upgrade the database using update.php.
See the change in the date format.

Proposed resolution

The date format should be retained.

🐛 Bug report
Status

Active

Version

10.3

Component

datetime.module

Created by

🇩🇪Germany sandro_pagliara

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

Comments & Activities

  • Issue created by @sandro_pagliara
  • The datetime module did not change between Drupal versions 10.3.8 and 10.3.10. Which updates executed with update.php on the site?

    When I install a default 10.3.8 site in English, there isn't a date format at /admin/config/regional/date-time that is Y-m-d H:i:s. There is:

    • Default long date l, F j, Y - H:i
    • Default medium date D, m/d/Y - H:i
    • Default short date m/d/Y - H:i
    • Olivero medium j F, Y

    But just to test I changed "Default short date" to m/d/Y and updated Drupal to 10.3.10. There are no Drupal core database updates between 10.3.8 and 10.3.10 when running update.php. The date format did not change.

    It is likely there are additional steps to reproduce that are not recorded in this issue. We require more information from you to proceed with this bug report.,

  • 🇮🇳India ramprassad

    I tried and could not reproduce this issue. As cilefen mentions in the above comment, "Y-m-d H:i:s" is not one of the available formats. I tried creating a custom date format in 10.3.8 with "Y-m-d H:i:s" and then changed to "Y-m-d". After upgrading to 10.3.10, I still see the date format as "Y-m-d".

Production build 0.71.5 2024