LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-23-2023, 09:46 AM   #1
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 268

Rep: Reputation: 89
Dolphin (KDE 5): Get ISO 8601 compliant date & time shown for files & folders.


affected software: Dolphin 21.12.1; KDE 5.23.5 (parts of Slackware64 15.0)

"Time" is set to en_SE in "KDE control center" because this setting provides ISO 8601 compliant date & time format "YYYY-MM-DD HH:MM (24 hrs)". All other settings are set to en_DE due to my localisation and preferred language for computing.

Unfortunately, Dolphin ignores this "time" setting and shows date & time in this annoying "mM/dD/YY hH:MM (12 hrs)" format.

Example:
ISO 8601: 2023-05-08 15:37
Dolphin: 5/8/23 3:37 PM

How can I set Dolphin to use ISO 8601 compliant date & time?
 
Old 06-23-2023, 05:30 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,807

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
I don't believe it is possible currently. Similar discussions...
https://www.reddit.com/r/ISO8601/com...o8601cldr5769/
https://superuser.com/questions/1162...ormat-in-kde-5

Maybe the pragmatic option is to use a different file manager. For example, Midnight Commander perhaps?
https://www.linuxquestions.org/quest...ss-4175528439/
 
Old 06-24-2023, 07:17 AM   #3
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 268

Original Poster
Rep: Reputation: 89
Quote:
Originally Posted by ferrari View Post
This works for KDE 5 itself but not for Dolphin.

Quote:
Originally Posted by ferrari View Post
Maybe the pragmatic option is to use a different file manager. For example, Midnight Commander perhaps?
https://www.linuxquestions.org/quest...ss-4175528439/

Done & works, but I'm using Midnight Commander (mc) in console (pure console & terminal windows on GUI) context only. mc is not an option as Dolphin replacement for me.

Going the rocky road gives a partial solution. I've created an en_DE locale with ISO 8601 compliant date & time format¹. This works on pure console & terminal windows on GUI. It removes this annoying "mM/dD/YY hH:MM (12 hrs)" format from Dolphin, but current format in Dolphin doesn't change to "YYYY-MM-DD HH:MM:SS (24 hrs)". It changes to "DD/MM/YYYY HH:MM (24 hrs)" format instead. This is quite better than "mM/dD/YY hH:MM (12 hrs)" format but not optimal.

¹Installation of en_DE with ISO 8601 compliant date & time, installation description for Slackware64 15.0:

download so that the locale file is accessible as /usr/share/i18n/locales/en_DE
become root
run: localedef --no-archive -f UTF-8 -i en_DE en_DE.utf8
command above creates /usr/lib64/locale/en_DE.utf-8 with content
set your system or account default locale to en_DE.utf-8, for system locale: edit /etc/profile.d/lang.sh and lang.csh
reboot, or log off and back on, to activate the new locale

en_DE
Code:
comment_char %
escape_char /

% Current state: This file is NOT part of the GNU C Library and contains locale data.
% The Free Software Foundation does not claim any copyright interest
% in the locale data contained in this file.  The foregoing does not
% affect the license of the GNU C Library as a whole.  It does not
% exempt you from the conditions of the license if your use would
% otherwise be governed by that license.

% Locale for English locale in Germany with ISO 8601 compliant date & time
% de_DE Contributed by Ulrich Drepper <drepper@redhat.com>, 2000
% en_DE Contributed by Soenke Kraft <soenke.kraft@sackpfeyffer-zu-linden.de>, 2023

LC_IDENTIFICATION
title      "English locale for Germany"
source     "derived from de_DE from Free Software Foundation, Inc."
address    ""
contact    ""
email      ""
tel        ""
fax        ""
language   "English"
territory  "Germany"
revision   "1.0"
date       "2023-06-24"

category "i18n:2012";LC_IDENTIFICATION
category "i18n:2012";LC_CTYPE
category "i18n:2012";LC_COLLATE
category "i18n:2012";LC_TIME
category "i18n:2012";LC_NUMERIC
category "i18n:2012";LC_MONETARY
category "i18n:2012";LC_MESSAGES
category "i18n:2012";LC_PAPER
category "i18n:2012";LC_NAME
category "i18n:2012";LC_ADDRESS
category "i18n:2012";LC_TELEPHONE
category "i18n:2012";LC_MEASUREMENT
END LC_IDENTIFICATION

LC_CTYPE
copy "i18n"

translit_start

include "translit_combining";""

% German umlauts.
% LATIN CAPITAL LETTER A WITH DIAERESIS.
<U00C4> "A<U0308>";"AE"
% LATIN CAPITAL LETTER O WITH DIAERESIS.
<U00D6> "O<U0308>";"OE"
% LATIN CAPITAL LETTER U WITH DIAERESIS.
<U00DC> "U<U0308>";"UE"
% LATIN SMALL LETTER A WITH DIAERESIS.
<U00E4> "a<U0308>";"ae"
% LATIN SMALL LETTER O WITH DIAERESIS.
<U00F6> "o<U0308>";"oe"
% LATIN SMALL LETTER U WITH DIAERESIS.
<U00FC> "u<U0308>";"ue"

% Danish.
% LATIN CAPITAL LETTER A WITH RING ABOVE.
<U00C5> "A<U030A>";"AA"
% LATIN SMALL LETTER A WITH RING ABOVE.
<U00E5> "a<U030A>";"aa"

% The following strange first-level transliteration derive from the use
% U201E and U201C as "correct" quoting characters.  These two characters
% do not really belong together.  The result is that somebody who uses
% U201C and U201D will get the incorrect U00AB / U00BB sequences.
% LEFT DOUBLE QUOTATION MARK
<U201C> <U00AB>;<U0022>
% RIGHT DOUBLE QUOTATION MARK
<U201D> <U00BB>;<U0022>
% DOUBLE LOW-9 QUOTATION MARK
<U201E> <U00BB>;"<U002C><U002C>"
% DOUBLE HIGH-REVERSED-9 QUOTATION MARK
<U201F> <U00AB>;<U0022>

translit_end

END LC_CTYPE

LC_COLLATE

% Copy the template from ISO/IEC 14651
copy "iso14651_t1"

END LC_COLLATE

LC_MONETARY
int_curr_symbol     "EUR "
currency_symbol     "<U20AC>"
mon_decimal_point   ","
mon_thousands_sep   "."
mon_grouping        3;3
positive_sign       ""
negative_sign       "-"
int_frac_digits     2
frac_digits         2
p_cs_precedes       0
p_sep_by_space      1
n_cs_precedes       0
n_sep_by_space      1
p_sign_posn         1
n_sign_posn         1
%
END LC_MONETARY

LC_NUMERIC
decimal_point   ","
thousands_sep   "."
grouping        3;3
END LC_NUMERIC

LC_TIME
abday    "Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat"
day      "Sunday";/
     "Monday";/
     "Tuesday";/
     "Wednesday";/
     "Thursday";/
     "Friday";/
     "Saturday"
abmon    "Jan";"Feb";/
     "Mar";"Apr";/
     "May";"Jun";/
     "Jul";"Aug";/
     "Sep";"Oct";/
     "Nov";"Dec"
mon      "January";/
     "February";/
     "March";/
     "April";/
     "May";/
     "June";/
     "July";/
     "August";/
     "September";/
     "October";/
     "November";/
     "December"
% date formats following ISO 8601-1988
d_t_fmt  "%Y-%m-%dT%T %Z"
date_fmt "%Y-%m-%dT%T %Z"
d_fmt    "%Y-%m-%d"
t_fmt    "%T"
am_pm    "";""
t_fmt_ampm  ""
week    7;19971130;4
first_weekday 2
END LC_TIME

LC_MESSAGES
yesexpr "^[+1jJyY]"
noexpr  "^[-0nN]"
yesstr  "yes"
nostr   "no"
END LC_MESSAGES

LC_PAPER
copy "i18n"
END LC_PAPER

LC_NAME
name_fmt    "%d%t%g%t%m%t%f"
name_miss   "Miss"
name_mr     "Mister"
name_mrs    "Miss"
name_ms     "Miss"
END LC_NAME


LC_ADDRESS
postal_fmt    "%f%N%a%N%d%N%b%N%s %h %e %r%N%z %T%N%c%N"
country_name  "Germany"
country_post  "D"
country_ab2   "DE"
country_ab3   "DEU"
country_num   276
country_car   "D"
country_isbn  3
lang_name     "German"
lang_ab       "de"
lang_term     "deu"
lang_lib      "ger"
END LC_ADDRESS

LC_TELEPHONE
tel_int_fmt    "+%c %a %l"
tel_dom_fmt    "%A %l"
int_select     "00"
int_prefix     "49"
END LC_TELEPHONE

LC_MEASUREMENT
copy "i18n"
END LC_MEASUREMENT
 
Old 06-24-2023, 10:01 AM   #4
lvm_
Member
 
Registered: Jul 2020
Posts: 926

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
WFM. Admittedly, my Plasma is not the freshest one - 5.12, but dolphin reacts to setting LC_TIME as expected, including en_SE
Click image for larger version

Name:	Screenshot_20230624_175933.png
Views:	43
Size:	73.8 KB
ID:	41243
 
Old 06-24-2023, 05:57 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,807

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Originally Posted by Arnulf View Post
This works for KDE 5 itself but not for Dolphin.
I know, and it is what I stated to you in my previous post. I was merely pointing you at similar discussions.

Quote:
Done & works, but I'm using Midnight Commander (mc) in console (pure console & terminal windows on GUI) context only. mc is not an option as Dolphin replacement for me.
Midnight Commander was just an example, (and it is popular amongst those using non-GUI environments). You surely can research alternatives which provide the capability that you require?
 
Old 06-24-2023, 06:07 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,807

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Originally Posted by lvm_ View Post
WFM. Admittedly, my Plasma is not the freshest one - 5.12, but dolphin reacts to setting LC_TIME as expected, including en_SE
Attachment 41243
Yes, not something I had tried (or ever required), but as it was also mentioned in the superuser answers, I set en_SE via System Settings, and indeed time stamps doe display in Dolphin as required.

Last edited by ferrari; 06-24-2023 at 06:10 PM.
 
Old 06-27-2023, 03:28 PM   #7
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 268

Original Poster
Rep: Reputation: 89
Quote:
Originally Posted by ferrari View Post
I set en_SE via System Settings, and indeed time stamps doe display in Dolphin as required.
This doesn't work on the other side of the world.

Following solution works here, but it's a little bit strange:
  • download (currently unofficial) en_SE e.g. from http://www.stacken.kth.se/~auno/en_SE
  • edit en_SE: replace all entries en_SE:2000 with i18n:2012
  • become root
  • copy en_SE to /usr/share/i18n/locales
  • run: localedef --no-archive -f UTF-8 -i en_SE en_SE.utf8
  • command above creates /usr/lib64/locale/en_SE.utf-8 with content
  • edit /etc/profile.d/lang.sh: entry LC_COLLATE=C can be left unchanged, values of all other LC_ entries must be changed to en_SE.utf-8
  • edit /etc/profile.d/lang.csh: entry LC_COLLATE C can be left unchanged, values of all other LC_ entries must be changed to en_SE.utf-8 *** not tested whether this step is required or only recommended for unification ***
  • reboot & start KDE 5
  • go to [KDE] "System Settings" → "Regional Settings" → "Formats"
  • Activate "Detailed Settings"
  • Set "Time" to "Sweden - English (en_SE)"
  • Set all other settings to desired English language based values *** only tested with "Germany - English (en_DE)" ***
This solution looks like that KDE 5 must believe at startup that the computer is located in Sweden and not e.g. in Germany to show date & time format "YYYY-MM-DD HH-MM (24 hrs)" in Dolphin.

Last edited by Arnulf; 06-27-2023 at 04:38 PM.
 
Old 06-27-2023, 04:40 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,807

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
Originally Posted by Arnulf View Post
This solution looks like that KDE 5 must believe at startup that the computer is located in Sweden and not e.g. in Germany to show date & time format "YYYY-MM-DD HH-MM (24 hrs)" in Dolphin.
As per lvm's comments, that what worked for me. This reads the same.
 
Old 02-23-2024, 08:21 AM   #9
salvadorlinuxquestion
LQ Newbie
 
Registered: Feb 2024
Posts: 2

Rep: Reputation: 0
environmental variables

For me, on Fedora, the above solutions recently stopped working for dolphin.
My current solution is as follows.

_________________________________________________________

(right click on the kde menu)
> edit applications
> (edit the applications as follows)

environmental variables: LC_TIME=en_SE.UTF-8
program: dolphin

> save
> (drag the icon from the menu to the panel)

> (if the position is wrong, then do as follows)
(right click on it)
enter edit mode
(drag it to the correct position)
<esc>
<esc>

_________________________________________________________

For the rest of KDE, the old solution to have the time iso format:
yyyy-mm-dd
and the 24-hour clock keeps working, and it is as follows.

(click on the kde menu)
> settings
> system settings
> regional settings
> region & language
> (on the right-most side of the "time" line, click) modify
> (search for sweden)
> (click on) english (sweden)
> (close the system settings application)

_________________________________________________________

I also added the following lines to the ~/.bashrc file of the user.

### to prevent warnings when using the kde time format "english sweden"
export LC_ALL=C

Last edited by salvadorlinuxquestion; 02-23-2024 at 08:25 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[KDE/Dolphin] Issues with Dolphin and io-slave. WisdomFire Manjaro 3 08-28-2020 05:30 PM
LXer: How to validate ISO 8601 dates without regex LXer Syndicated Linux News 0 10-04-2018 07:39 PM
preserve date time stamp copying files over home lan with samba, dolphin glorsplitz Slackware 1 07-22-2016 05:38 AM
Hidden files not shown in 'find' of Dolphin in KDE4 rng Linux - General 5 04-28-2012 07:50 PM
While booting no option is shown for Linux! Only windows xp is shown!! mon avis Linux - General 7 08-06-2006 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration