how to edit LC_TIME variables: date_fmt, d_t_fmt, t_fmt?

Please advise as to how I can change variables contained within LC_TIME?

Using Leap 15.1 the default date format when using bash was “Wed Jul 14 19:00:53 EDT 2021”
but now using Leap 15.3 the default date format is date date “Wed 14 Jul 2021 07:00:06 PM EDT”

It appears that this change is due to a change the locale parameter LC_TIME
My current parameter variables are as follows:

locale -k 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"
am_pm="AM;PM"
d_t_fmt="%a %d %b %Y %r %Z"
d_fmt="%m/%d/%Y"
t_fmt="%r"
t_fmt_ampm="%I:%M:%S %p"
era=
era_year=""
era_d_fmt=""
alt_digits=
era_d_t_fmt=""
era_t_fmt=""
time-era-num-entries=0
time-era-entries="S"
week-ndays=7
week-1stday=19971130
week-1stweek=1
first_weekday=1
first_workday=2
cal_direction=1
timezone=""
date_fmt="%a %d %b %Y %r %Z"
time-codeset="UTF-8"
alt_mon="January;February;March;April;May;June;July;August;September;October;November;December"
ab_alt_mon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"

I’d like to change three of LC_TIME’s variables: “date_fmt”, “d_t_fmt”, “t_fmt”
I’d like to change them to:
date_fmt = d_t_fmt = “%a %b %d %T %Z %Y”
t_fmt = “%T”

BTW, everything on my system is set to en_US.UTF-8. Again, the question is NOT how to reset my LANG or LOCALE.

I also noticed that the the default date format for bash is different for “root” verses “user”.

root displays the traditional date format “Wed Jul 14 19:00:53 EDT 2021” (the format I want)
while user displays the new date format “Wed 14 Jul 2021 07:00:06 PM EDT” (the format I do NOT want)

Somebody tinkered with your LANG value:

karl@erlangen:~> echo $LANG 
de_DE.UTF-8 
karl@erlangen:~> date 
Do 15. Jul 06:45:34 CEST 2021 
karl@erlangen:~> LANG=en_US.UTF-8 date 
Thu Jul 15 06:45:36 AM CEST 2021 
karl@erlangen:~> 

How do you know it? You did not show values of LANG or LC_TIME or LC_ALL in previous and current Leap versions so we have no reason to believe it is not relevant. Often the most obvious answer is still correct even if it is obvious.

This has always been this way in openSUSE. By default root has POSIX locale except LC_CTYPE which is taken from global settings. Which just confirms that the problem is most likely in value of locale.

Again, my query pertains directly how to change the variables within the parameter LC_TIME because I am interested to learn how these variables can be “tweaked”. In addition, these “tweaks” would greatly speed up support for legacy code globally (being proactive) rather than waiting to fix broken dependencies(retroactive).

Thank you, “karlmistelberger” for showing me your system’s response to date. (btw, I read your previous posts on this subject in these forums). Your system’s output raises another concern.

Why is your LC_TIME date_fmt variable different from mine despite both us using the same LANG=en_US.UTF-8?

karl@erlangen:~> LANG=en_US.UTF-8 date
Thu Jul 15 06:45:36 AM CEST 2021

My date output
Thu 15 Jul 2021 08:58:52 AM EDT

Yours ="%a %b %d %r %Z %Y"
Mine = “%a %d %b %Y %r %Z”

However, for those curious, here are the contents of the relevant files as outlined in the openSUSE references and some pertinent command line responses.

If you’d would like more details, I’ll be happy to oblige.

I can add one more detail as to how this change caught my attention. I performed an in-place system upgrade from an existing 15.1 to 15.2, and then to 15.3 in the span of 2 hours, then noticed bash scripts breaking.

echo $LANG
en_US.UTF-8

echo $LC_MESSAGES
null

cat ~.i18n
null

ls -ls /usr/share/locale/en_US/LC_MESSAGES
4 -rw-r--r-- 1 root root   369 Oct  3  2019 command-not-found.mo
28 -rw-r--r-- 1 root root 28510 Apr  9 04:38 firewalld.mo
 4 -rw-r--r-- 1 root root   383 Jun  9 11:40 libstorage-ng.mo
 4 -rw-r--r-- 1 root root   369 Apr 22 17:52 mit-krb5.mo
28 -rw-r--r-- 1 root root 26161 Jun 22  2020 openconnect.mo
 4 -rw-r--r-- 1 root root   369 Jun  5  2020 pam-config.mo
 4 -rw-r--r-- 1 root root   369 Oct  3  2019 scout.mo
 4 -rw-r--r-- 1 root root   466 Mar 31 03:07 snapper.mo

ls -ls /usr/share/locale/en/LC_MESSAGES    
 4 -rw-r--r-- 1 root root   1543 Jun  5  2020 accounts-service.mo
  4 -rw-r--r-- 1 root root    999 Oct  2  2020 gnome-desktop-3.0.mo
  4 -rw-r--r-- 1 root root   3222 Aug 28  2020 gtk30.mo
  4 -rw-r--r-- 1 root root    326 Aug 28  2020 gtk30-properties.mo
  4 -rw-r--r-- 1 root root    456 Aug 13  2020 icewm.mo
108 -rw-r--r-- 1 root root 107756 Jun  5  2020 iso_3166-2.mo
  4 lrwxrwxrwx 1 root root     13 Jun  5  2020 iso_3166_2.mo -> iso_3166-2.mo
  4 -rw-r--r-- 1 root root    488 Mar  5 17:51 kcoreaddons5_qt.qm
  4 -rw-r--r-- 1 root root   1477 Mar  6 04:00 kjobwidgets5_qt.qm
  4 -rw-r--r-- 1 root root    306 Mar  5 17:50 kwidgetsaddons5_qt.qm
132 -rw-r--r-- 1 root root 133909 Mar  5 21:34 lynx.mo

locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

/etc/sysconfig/language

cat /etc/sysconfig/language

## Path:        System/Environment/Language
## Type:        string(ibus,fcitx,gcin,scim,scim-bridge,uim,kinput2,kinput2-canna,kinput2-wnn,nabi,wnn,atokx,xcin,none)
## Default:     ""
#
# A default input method to be used in X11 can be selected here.
# If this variable is set and a script with the same name
# as the value of this variable exists in the directory /etc/X11/xim.d/
# this script is sourced when X11 is started to start an input method.
#
# The special value "none" (/etc/X11/xim.d/none) means:
# Do not use any input method at all.
#
# For more details see the comments at the top of /etc/X11/xim.
#
INPUT_METHOD=""
## Path:        System/Environment/Language
## Description:
## Type:        string(POSIX,ca_ES.ISO-8859-1,ca_ES.UTF-8,cs_CZ.ISO-8859-2,cs_CZ.UTF-8,da_DE@euro,da_DK.ISO-8859-1,da_DK.UTF-8,de_DE@euro,de_DE.ISO-8859-1,de_DE.UTF-8,el_GR.ISO-8859-7,el_GR.U
TF-8,en_GB.ISO-8859-1,en_GB.UTF-8,en_IE@euro,en_IE.ISO-8859-1,en_US.ISO-8859-1,es_ES@euro,es_ES.ISO-8859-1,es_ES.UTF-8,fr_FR@euro,fr_FR.ISO-8859-1,fr_FR.UTF-8,gl_ES@euro,gl_ES.ISO-8859-1,gl_E
S.utf-8,hr_HR.ISO-8859-2,hu_HU.ISO-8859-2,hu_HU.UTF-8,it_IT@euro,it_IT.ISO-8859-1,it_IT.UTF-8,ja_JP.eucJP,ja_JP.UTF-8,lt_LT.ISO-8859-13,lt_LT.UTF-8,nl_NL@euro,nl_NL.ISO-8859-1,nl_NL.UTF-8,ru_
RU.ISO-8859-5,ru_RU.KOI8-R,ru_RU.UTF-8,sk_SK.ISO-8859-2,sk_SK.UTF-8,tr_TR.ISO-8859-9,tr_TR.UTF-8,ko_KR.eucKR,ko_KR.UTF-8,zh_TW.Big5,zh_TW.UTF-8,zh_CN.GB2312,zh_CN.UTF-8)
## Default:     ""
## Config:      OpenOffice.org,groff,ispell,kde,kdm,profiles,susehelp,susewm,tetex,wdm
#
#
# Local users will get RC_LANG as their default language, i.e. the
# environment variable $LANG . $LANG is the default of all $LC_*-variables,
# as long as $LC_ALL is not set, which overrides all $LC_-variables.
# Root uses this variable only if ROOT_USES_LANG is set to "yes".
#
RC_LANG=""                                                                                                                                                                                      
                                                                                                                                                                                                
## Type:        string                                                                                                                                                                          
## Default:     ""                                                                                                                                                                              
#                                                                                                                                                                                               
# This variable will override all LC-variables!!                                                                                                                                                
# Again, ROOT_USES_LANG must be set to "yes", if an effect on the superuser                                                                                                                     
# account is desired.                                                                                                                                                                           
#                                                                                                                                                                                               
RC_LC_ALL=""                                                                                                                                                                                    
                                                                                                                                                                                                
## Type:        string                                                                                                                                                                          
## Default:     ""                                                                                                                                                                              
#                                                                                                                                                                                               
# This defines the locale in which messages of programs and                                                                                                                                     
# libraries with i18n-support should appear if a translated                                                                                                                                     
# message catalog for the library or the program is installed.                                                                                                                                  
# This also provides localized yes/no answers.                                                                                                                                                  
#                                                                                                                                                                                               
RC_LC_MESSAGES=""                                                                                                                                                                               
                                                                                                                                                                                                
## Type:        string                                                                                                                                                                          
## Default:     ""                                                                                                                                                                              
#                                                                                                                                                                                               
# This defines the locale for character handling and classification.
# The libc uses this value in language dependent function calls, such
# as e.g. uppercase/lowercase mapping of foreign characters.
#
RC_LC_CTYPE=""

## Type:        string
## Default:     ""
#
# This defines the locale for sorting strings and characters.
# It is used by the libc to obtain the alphabetical order of characters
# (e.g. for string comparisons).
#
RC_LC_COLLATE=""

## Type:        string
## Default:     ""
#
# This defines the locale for date and time output formats.
# i.e.: 06/09/1999 vs. 09.06.1999
#
RC_LC_TIME=""

## Type:        string
## Default:     ""
#
# This defines the locale for formatting and reading numbers.
# i.e.: 1,234.56 vs. 1.234,56
#
RC_LC_NUMERIC=""

## Type:        string
## Default:     ""
#
# This defines the locale for formatting and reading money values.
#
RC_LC_MONETARY=""

## Type:        string
## Default:     ""
#
# This defines the locale for format of paper.
#
RC_LC_PAPER=""

## Type:        string(ctype)
## Default:     ctype
#
# This defines if the user "root" should use the locale settings
# which are defined here.
# Value "ctype" means that root uses just LC_CTYPE.  
# Value "yes" means that root uses the full settings..  
#
ROOT_USES_LANG="ctype"

## Type:        yesno
## Default:     no
#
# Workaround for missing forward of LANG and LC variables
# of e.g. ssh login connections.
#
AUTO_DETECT_UTF8="no"

## Type:        string
## Default:     ""
#
# List of installed language supports, use by YaST2
#
INSTALLED_LANGUAGES=""

/etc/profile (due to character length limits imposed on posts 15k, contents are not shown. I did not amend this file)

~/.bashrc

cat ~/.bashrc
# Sample .bashrc for SuSE Linux
# Copyright (c) SuSE GmbH Nuernberg

# There are 3 different types of shells in bash: the login shell, normal shell
# and interactive shell. Login shells read ~/.profile and interactive shells
# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
# settings made here will also take effect in a login shell.
#
# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.

# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit

# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server

# If you want to use a Palm device with Linux, uncomment the two lines below.
# For some (older) Palm Pilots, you might need to set a lower baud rate
# e.g. 57600 or 38400; lowest is 9600 (very slow!)
#
#export PILOTPORT=/dev/pilot
#export PILOTRATE=115200

test -s ~/.alias && . ~/.alias || true

PATH="/home/me/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/me/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/me/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/me/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/me/perl5"; export PERL_MM_OPT;

Locale definition:

karl@erlangen:~> cat .config/plasma-localerc  
[Formats] 
LANG=de_DE.UTF-8 

[Translations] 
LANGUAGE=de:en_US 
karl@erlangen:~> 

User locale is:

karl@erlangen:~> locale 
LANG=de_DE.UTF-8 
LC_CTYPE="de_DE.UTF-8" 
LC_NUMERIC="de_DE.UTF-8" 
LC_TIME="de_DE.UTF-8" 
LC_COLLATE="de_DE.UTF-8" 
LC_MONETARY="de_DE.UTF-8" 
LC_MESSAGES="de_DE.UTF-8" 
LC_PAPER="de_DE.UTF-8" 
LC_NAME="de_DE.UTF-8" 
LC_ADDRESS="de_DE.UTF-8" 
LC_TELEPHONE="de_DE.UTF-8" 
LC_MEASUREMENT="de_DE.UTF-8" 
LC_IDENTIFICATION="de_DE.UTF-8" 
LC_ALL= 
karl@erlangen:~> 

Note:

karl@erlangen:~> LANG=en_US.UTF-8 LC_TIME=en_US.UTF-8 date 
Thu Jul 15 03:42:08 PM CEST 2021 
karl@erlangen:~> 

Use localedef to create your own: en_DE.utf8

Here are more commands execute as user:

> echo $ROOT_USES_LANG
null

> echo $RC_LANG
null

> echo $POSIX
null

> date
Thu 15 Jul 2021 11:28:50 AM EDT

> LANG=en_US.UTF-8 date
Thu 15 Jul 2021 11:30:32 AM EDT

> LANG=POSIX date
Thu Jul 15 11:28:39 EDT 2021

> LANG=C date
Thu Jul 15 11:29:56 EDT 2021

> LANG=en date
Thu Jul 15 11:30:22 EDT 2021

As you can see 3 definitions (LANG=en, C, POSIX) all produce the same date_fmt="%a %b %d %T %Z %Y"
LANG=en_US.UTF-8 does not ("%a %d %b %Y %r %Z")