解决欧拉系统date显示相关问题

1.解决欧拉系统date显示12小时制问题

1.1查看默认的时间显示格式

[root@xx xx]# date
Mon Sep 23 02:45:01 PM CST 2024

1.2修改为24小时制

1.2.1 编辑/etc/profile文件

执行vi /etc/profile命令在文件末行增加export LC_TIME=POSIX,修改完后保存退出。

1.2.2 使配置生效

执行如下命令:

[root@xx ~]# source /etc/profile

1.2.3 检查时间显示格式

[root@xxx xxx]# date
Mon Sep 23 14:51:53 CST 2024

2.时区调整

2.1 查看当前时区

[root@openeuler xxx]# timedatectl status
               Local time: Tue 2024-09-24 15:12:20 CST
           Universal time: Tue 2024-09-24 07:12:20 UTC
                 RTC time: Tue 2024-09-24 07:12:20
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

2.2 更改时区

sudo timedatectl set-timezone Asia/Shanghai

2.3 确认更改

[root@openeuler xxx]# timedatectl status
               Local time: Tue 2024-09-24 15:18:13 CST
           Universal time: Tue 2024-09-24 07:18:13 UTC
                 RTC time: Tue 2024-09-24 07:18:13
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
[root@openeuler xxx]# date
Tue Sep 24 03:18:15 PM CST 2024
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值