Score:0

Timezone with 12h time format (AM/PM)

ch flag
xXx

I have a problem with timezone in debian

I need to set up zone with 12h format (AM/PM) throughout the system. Locale set to "en_US.UTF.8", output "date" command is correctly. Time format in "timedatectl" is incorrect (24h). Any ideas?

Locale:

LANG=en_US.UTF-8
LANGUAGE=
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=en_US.UTF-8

timedatectl

    Local time: Mon 2022-02-21 20:09:15 CET
           Universal time: Mon 2022-02-21 19:09:15 UTC
                 RTC time: Mon 2022-02-21 19:09:14
                Time zone: Europe/Warsaw (CET, +0100)
System clock synchronized: no
              NTP service: active
          RTC in local TZ: no

date

Mon 21 Feb 2022 08:09:08 PM CET

systemctl process status

   Active: active (running) since Mon 2022-02-21 20:09:01 CET; 22s ago


    
Score:0
ru flag

12 hour AM/PM or 24 hour format is a matter of locale preference - not the time zone.

ch flag
xXx
Ok, how can i get 12H (AM/PM) in systemctl process status? In my process i have a errors with bad parsing time. I think changing the time display to AM / PM will solve the problem
Score:0
cn flag

timedatectl will not print 12-hour time, calls strftime() with %a %Y-%m-%d %H:%M:%S

GNU coreutils date calls localized functions which in some cases can call strftime() with hour minute second of %I:%M:%S %I is 12-hour hours. Also date can be called with a custom format, for example date +%r

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.