14

I've been using Dolphin for organising pictures. I would like to see the modification time and date displayed in ISO format. It is easier to read for me. I used to be able to configure that in KDE 4:

KDE4 time format widget

In KDE5 the widget has been replaced by this:

KDE5 time format widget

Is there a way to configure this in KDE5?

  • On my system (Open Suse Leap 15.0) I specify ISO format in the KDE Time format settings, but Dolphin just ignores it and uses dd/mm/yyyy! Very irritating! – PJTraill Aug 8 '18 at 22:58
10

I find en_SE to be fully ISO-compliant: YYYY-MM-DD HH:MM (24h)

Whereas for me en_DK uses DD/MM/YYYY HH.MM (24h) which is not ISO compliant both in the date order (it's simply a western europe order) and in the time separator.

en_CA uses YYYY-MM-DD hh:MM (12h) likewise close but uses AM/PM rather than 24h.

Tested on KDE Plasma 5.11.3, running on Arch Linux.

| improve this answer | |
  • I've been using that, and it is fine in KDE. However, the rest of the system does not have an en_SE locale, which causes problems with many programs. – Caleb Reister Apr 18 '18 at 19:15
  • 1
    The full label for en_SE is "Sweden - English (en_SE)" – EL_DON Aug 22 '18 at 15:59
  • en_DK used to work for me, but now it does the date backwards (DDMMYYYY). – EL_DON Aug 22 '18 at 16:01
  • 3
    I had to add en_SE manually, using the link from this comment. Put it in /usr/share/i18n/locales/en_SE, replace "en_SE:2000" with "i18n:2012", then run sudo locale-gen – Kael Watts-Deuchar Oct 19 '18 at 15:46
  • 4
    Oh I also had to add en_SE.UTF-8 UTF-8 to /etc/locale.gen – Kael Watts-Deuchar Oct 19 '18 at 15:55
3

No that is impossible. Is is not possible to manually set the formats like it was possible in KDE4. You always have to choose a locale for each category (Number, Time, Currency, Units, Collation)

Unfortunately installing a more standards compliant locale (like en_DK or en_NL) does not help. KDE5 uses its own list of locales, ignoring the system locales.

For the desktop clock you can set the date and time format apart from the system format in newer version of KDE 5.

| improve this answer | |
2

One locale which uses ISO 8601 timestamps is en_DK.

I'm guessing KDE 5 returned to the POSIX locale mechanism for consistency. KDE 4 was the odd one – practically all other programs use the POSIX-format locale settings, with predefined formats. (This means the settings will be understood by non-KDE programs, too.)


If KDE doesn't list en_DK, grep the output of locale -a to check whether the en_DK.utf8 item is available. If it isn't, on Debian/Ubuntu you should be able to add it via dpkg-reconfigure locales. On other distributions, if there is /etc/locale.gen, add (or uncomment) the following lines to it:

en_DK.UTF-8 UTF-8
en_DK ISO-8859-1

Run locale-gen to rebuild.


If KDE still doesn't list en_DK despite locale -a showing it, you should still be able to set it globally. The above formats correspond directly to POSIX locale environment variables:

  • Region → LANG
  • Numbers → LC_NUMERIC
  • Time → LC_TIME
  • Currency → LC_MONETARY
  • Units → LC_MEASUREMENT
  • Sorting → LC_COLLATE

The system-wide location for these varies. Often you can set them via localectl:

localectl set-locale LANG="en_US.UTF-8" LC_TIME="en_DK.UTF-8"

Sometimes you'll have to edit /etc/locale.conf, /etc/default/locale, or similar.

Per-user, the same can be set in ~/.pam_environment, ~/.profile, ~/.bash_profile, or similar.

| improve this answer | |
  • I cannot find en_DK on the list (it's sorted by name and the only Danish is Danish dk_DK). The widget was there since I can remember, at least KDE3. – dhill Jan 2 '17 at 11:55
  • I found that en_GB has an acceptable (day-month-year) layout. – dhill Jan 3 '17 at 10:38
  • I tried en_DK, but saw no change from en_GB. – ctrl-alt-delor Sep 6 '17 at 8:33
  • I checked, and it doesn’t use POSIX locales at all. Which can be verified by seeing that the Plasma5 UI contains elements (e.g. ksh_DE) that are not present in /usr/share/i18n/locales. A find / -iname '*ksh_de*' does not even return any results. Bad KDE. BAD. Sit! – Evi1M4chine Jan 27 '18 at 14:04
  • en_DK used to work, but now it has the date format backwards (DDMMYYYY). en_SE (Sweden - English) is currently sorted correctly (YYYYMMDD). – EL_DON Aug 22 '18 at 16:03
1

I found that selecting Canada - Canadian English (en_CA) makes the short format ISO:

  • 2017-09-15 12:26 PM
  • Friday, September 15, 2017 12:25:34 PM GMT
| improve this answer | |
  • Unfortunately, speakers of other languages can not use this. – Evi1M4chine Jan 27 '18 at 14:07
1
vi /usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/DigitalClock.qml
- dateLabel.text = Qt.formatDate(main.currentTime, main.dateFormat);
+ dateLabel.text = Qt.formatDate(main.currentTime, "dd-MMM-yyyy");

Taken from https://www.ulduzsoft.com/2017/08/custom-date-configuration-in-kde-plasma-digital-clocks/

| improve this answer | |
  • Sorry but this is not what the question asks. At the most, you could put this as a comment. – salvador May 9 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.