Skip to content

Gnome Files (Nautilus) ISO Date Format

Gnome’s Control Center region/locale settings are intentionally mutable/configurable by the user to set/determine the preferred formats, but Gnome Files (Nautilus) is not honoring the user chosen date format(s) when the Detailed preference is set for Date and Time Format.

This became a point of focus for me because I prefer an ISO-esque date format in my file manager's list view. I stumbled upon this Gnome Discourse thread, which led me down the path to accomplish this.

This post is relevant to an environment running Gnome 46 and Gnome Files 46.1 (Ubuntu 24.04).

gnome-settings-vs-files

Screenshot showing locale settings in system preferences, as well as Gnome Files’ non-conforming format.


Create Translation File

Create a nautilus.po file with the following contents.

nautilus.po
#. Translators: date and time in 24h format,
#. * i.e. "2023-12-31 23:59"
#: src/nautilus-date-utilities.c:83
#, no-c-format
msgid "%m/%d/%Y %H:%M"
msgstr "%Y-%m-%d %H:%M"

#. Translators: date and time in 12h format,
#. * i.e. "2023-12-31 11:59 PM"
#: src/nautilus-date-utilities.c:90
#, no-c-format
msgid "%m/%d/%Y %I:%M %p"
msgstr "%Y-%m-%d %I:%M %p"

Convert Translation File

Convert the translation file to a .mo file using msgfmt (from gettext).

msgfmt nautilus.po -o nautilus.mo

Copy Converted Translation

Copy the .mo file to: /usr/share/locale/en/LC_MESSAGES

This requires sudo privilege.

Replace "en" with your current locale language directory.

sudo cp nautilus.mo /usr/share/locale/en/LC_MESSAGES/

Reboot

Reboot and verify Gnome Files is now showing dates in the preferred format based on the custom translation provides.

Gnome-Files-Date-Format-Preview

Screenshot showing Gnome Files’ conforming format.

Comments