Re: MX-19 Beta 2.1 Feedback
Posted: Tue Sep 17, 2019 9:10 am
Which other locales prefer 24 hour time? Is there an easy way for a program or script to figure this out that works on both antiX and MX?
Support for MX and antiX Linux distros
http://www.forum.mxlinux.org/
see my post above. there are only a few that want 12. so the live media defaults to 24 and then we set to 12 if we find one of those locales.AK-47 wrote: Tue Sep 17, 2019 9:10 am Which other locales prefer 24 hour time? Is there an easy way of figuring this out that works on both antiX and MX?
Code: Select all
case $LNG in
LANG=en_US.UTF-8|LANG=en_AU.UTF-8|LANG=en_CA.UTF-8|LANG=en_NZ.UTF-8|LANG=ar_EG.UTF-8|LANG=el_GR.UTF-8|LANG=sq_AL.UTF-8) changeto12hour
;;
Code: Select all
locale -k d_t_fmt | grep -sqo -E '%r|%p|%I' && echo 12h || echo 24h
Code: Select all
LANG=en_GB.UTF-8 locale -k d_t_fmt | grep -sqo -E '%r|%p|%I' && echo 12h || echo 24h
24h
LANG=en_US.UTF-8 locale -k d_t_fmt | grep -sqo -E '%r|%p|%I' && echo 12h || echo 24h
12h
Which raises the question is the above 12h-list of locales still valid if we take into account Debian's "nominative" LOCALE defintion for LC_TIME based on POSIX standard?dolphin_oracle wrote: Tue Sep 17, 2019 9:12 amsee my post above. there are only a few that want 12. so the live media defaults to 24 and then we set to 12 if we find one of those locales.AK-47 wrote: Tue Sep 17, 2019 9:10 am Which other locales prefer 24 hour time? Is there an easy way of figuring this out that works on both antiX and MX?
LNG is pulled from /etc/default/localeCode: Select all
case $LNG in LANG=en_US.UTF-8|LANG=en_AU.UTF-8|LANG=en_CA.UTF-8|LANG=en_NZ.UTF-8|LANG=ar_EG.UTF-8|LANG=el_GR.UTF-8|LANG=sq_AL.UTF-8) changeto12hour ;;
Code: Select all
DATE(1) User Commands DA
NAME
date - print or set the system date and time
FORMAT controls the output. Interpreted sequences are:
%c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
Code: Select all
for l in LANG=en_US.UTF-8 LANG=en_AU.UTF-8 LANG=en_CA.UTF-8 LANG=en_NZ.UTF-8 LANG=ar_EG.UTF-8 LANG=el_GR.UTF-8 LANG=sq_AL.UTF-8; do L=${l#LANG=}; D=$( LANG=$L TZ=Australia/Perth date '+%c' ); LANG=$L locale -k d_t_fmt | grep -sqo -E '%r|%p|%I' && echo "$L : 12h : $D" || echo "$L : 24h : $D"; done
en_US.UTF-8 : 12h : Wed 18 Sep 2019 03:48:23 PM AWST
en_AU.UTF-8 : 24h : Wed 18 Sep 2019 15:48:23 AWST
en_CA.UTF-8 : 12h : Wed 18 Sep 2019 03:48:23 PM AWST
en_NZ.UTF-8 : 24h : Wed 18 Sep 2019 15:48:23 AWST
ar_EG.UTF-8 : 12h : 18 سبت, 2019 AWST 03:48:24 م
el_GR.UTF-8 : 12h : Τετ 18 Σεπ 2019 03:48:24 μμ AWST
sq_AL.UTF-8 : 12h : 2019-Sht-18 03.48.24.MD AWST
Code: Select all
for l in $(locale -a| grep utf8 ); do L=${l%utf8}UTF-8; D=$( LANG=$L TZ=Australia/Perth date '+%c' ); LANG=$L locale -k d_t_fmt | grep -sqo -E '%r|%p|%I' && echo "$L : 12h : $D" || echo "$L : 24h : $D"; done | grep 12h
ar_EG.UTF-8 : 12h : 18 سبت, 2019 AWST 04:40:59 م
el_GR.UTF-8 : 12h : Τετ 18 Σεπ 2019 04:40:59 μμ AWST
en_CA.UTF-8 : 12h : Wed 18 Sep 2019 04:40:59 PM AWST
en_US.UTF-8 : 12h : Wed 18 Sep 2019 04:40:59 PM AWST
ko_KR.UTF-8 : 12h : 2019년 09월 18일 (수) 오후 04시 40분 59초
sq_AL.UTF-8 : 12h : 2019-Sht-18 04.40.59.MD AWST
Right, coming back to @chrispop99 mentioned regression and combine this with the above result about Debian's 12-h LC_TIME defintion, we might consider to change the way we are calling adjusting orageclock's time format.chrispop99 wrote: Tue Sep 17, 2019 4:13 am Time zone regression
In MX-18 and earlier versions, using the function keys at the boot screen to set Language to UK, and Time Zone to London allowed the Conky clock and the panel clock to display correctly in 24 hour format. During installation, on the 'Locale...' screen, the 'Configure clock' radio button was correctly pre-set to 24 hour format.
This is broken in MX-19; the function key settings are not respected as the clocks display in 12 hour format, and at the installer screen the 12 hour radio button is pre-set.
Question remains, is this list valid. Debian's locale definitions got updates over time.dolphin_oracle wrote: Wed Sep 18, 2019 6:35 am The time discussion is fascinating but I want to remind devs here that may not remember but we initially used the time formats described in the locale information and we were told by several users that they were incorrect. So we generated the list of exclusions instead.
Date_and_time_notation_in_Australia wrote: The Australian government allows writing the time using either the 24-hour clock (05:55), which is commonplace in technical fields such as aviation, computing, navigation, and the sciences; or the 12-hour clock (5:55 am). The before noon/after noon qualifier is usually written as "am" or "pm". A colon is the preferred time separator