linux修改系统时区

Posted on 2024-03-27 11:06  风行天下-2080  阅读(7)  评论(0编辑  收藏  举报

1、

https://wenku.csdn.net/answer/89f4b06ee65511edbcb5fa163eeb3507

 root@yao-test:~/testmysqlback# cat /etc/localtime
TZif2UTCTZif2UTC
UTC0
查看当前时区
root@yao-test:~/testmysqlback# timedatectl
               Local time: Wed 2024-03-27 02:58:44 UTC
           Universal time: Wed 2024-03-27 02:58:44 UTC
                 RTC time: Wed 2024-03-27 02:58:44    
                Time zone: Etc/UTC (UTC, +0000)       
System clock synchronized: yes                        
              NTP service: active                     
          RTC in local TZ: no                         
设置系统时区:
root@yao-test:~/testmysqlback# timedatectl set-timezone Asia/Shanghai

root@yao-test:~/testmysqlback# timedatectl
               Local time: Wed 2024-03-27 10:59:41 CST
           Universal time: Wed 2024-03-27 02:59:41 UTC
                 RTC time: Wed 2024-03-27 02:59:41    
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes                        
              NTP service: active                     
          RTC in local TZ: no                         
root@yao-test:~/testmysqlback# date
Wed 27 Mar 2024 10:59:45 AM CST

重启时区服务:::
root@yao-test:~/testmysqlback# systemctl restart systemd-timedated.service

root@yao-test:~/testmysqlback# date
Wed 27 Mar 2024 11:00:27 AM CST
列出可用的时区:::

root@yao-test:~/testmysqlback# timedatectl list-timezones

 

 

 

 

 

 

 

 

 

 

 

 

 

2、

Copyright © 2024 风行天下-2080
Powered by .NET 8.0 on Kubernetes