LC_TIME portability (and other locale settings)
1
vote
1
answer
546
views
It seems that Linux and FreeBSD (at least) have different notions of how presentation of time is implemented in different locales (LC_TIME), notably but not entirely in how the hour of day is presented (12 hr am/pm style or 24 hour).
Linux (as seen on recent Fedora & Ubuntu):
env LC_TIME=C.UTF-8 TZ=UTC date --date 22:22:22 '+%H %T %p, %r, %+, %Ec' ; env LC_TIME=en_US.UTF-8 TZ=UTC date --date 22:22:22 '+%H %T %p, %r, %+, %Ec'
22 22:22:22 PM, 10:22:22 PM, %+, Fri May 17 22:22:22 2024
22 22:22:22 PM, 10:22:22 PM, %+, Fri 17 May 2024 10:22:22 PM UTC
FreeBSD:
env LC_TIME=C.UTF-8 TZ=UTC date -v 22H -v 22M -v 22S '+%H %T %p, %r, %+, %Ec' ; env LC_TIME=en_US.UTF-8 TZ=UTC date -v 22H -v 22M -v 22S '+%H %T %p, %r, %+, %Ec'
22 22:22:22 PM, 10:22:22 PM, Fri May 17 22:22:22 UTC 2024, Fri May 17 22:22:22 2024
22 22:22:22 PM, 10:22:22 PM, Fri May 17 22:22:22 UTC 2024, Fri May 17 22:22:22 2024
My questions are: Is there a standard that defines presentation for various locale specific settings (like LC_TIME)? If so, where is the standard documented?
Asked by Juan
(914 rep)
May 17, 2024, 12:40 AM
Last activity: Jun 29, 2024, 07:15 AM
Last activity: Jun 29, 2024, 07:15 AM