Ubuntu22.04设置时区和24小时制

发布于:2025-06-24 ⋅ 阅读:(16) ⋅ 点赞:(0)

(base) root@ascend:~# date
Mon Jun 23 08:40:56 AM UTC 2025
(base) root@ascend:~# cat /etc/issue
Ubuntu 22.04 LTS \n \l

(base) root@ascend:~# timedatectl
               Local time: Mon 2025-06-23 08:41:49 UTC
           Universal time: Mon 2025-06-23 08:41:49 UTC
                 RTC time: Mon 2025-06-23 08:41:49
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
(base) root@ascend:~# timedatectl set-timezone Asia/Shanghai
(base) root@ascend:~# date
Mon Jun 23 04:42:04 PM CST 2025
(base) root@ascend:~# timedatectl
               Local time: Mon 2025-06-23 16:42:09 CST
           Universal time: Mon 2025-06-23 08:42:09 UTC
                 RTC time: Mon 2025-06-23 08:42:09
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
(base) root@ascend:~# date
Mon Jun 23 04:42:14 PM CST 2025
(base) root@ascend:~# 
(base) root@ascend:~# 

(base) root@ascend:~# 
(base) root@ascend:~# date
Mon Jun 23 04:42:20 PM CST 2025
(base) root@ascend:~# date
Mon Jun 23 04:42:46 PM CST 2025
(base) root@ascend:~# 
(base) root@ascend:~# 
(base) root@ascend:~# 

(base) root@ascend:~# cat /etc/default/locale 
LANG=en_US.UTF-8
(base) root@ascend:~# echo LC_TIME=en_DK.UTF-8 >> /etc/default/locale
(base) root@ascend:~# cat /etc/default/locale 
LANG=en_US.UTF-8
LC_TIME=en_DK.UTF-8
(base) root@ascend:~# date
Mon Jun 23 04:45:45 PM CST 2025
(base) root@ascend:~# su - root
(base) root@ascend:~# date
Mon Jun 23 16:45:54 CST 2025
(base) root@ascend:~# 


网站公告

今日签到

点亮在社区的每一天
去签到