linux修改系统时区

Posted on   风行天下-2080  阅读(92)  评论(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、

相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-03-27 python连接mysql数据库报错pymysql连接数据库报错TypeError: __init__() takes 1 positional argument but 5 positional arguments
2019-03-27 python远程执行dos命令
2018-03-27 linux教程
2018-03-27 vmware桥接模式无法上网

随笔 - 618, 文章 - 0, 评论 - 6, 阅读 - 37万

Copyright © 2025 风行天下-2080
Powered by .NET 9.0 on Kubernetes

点击右上角即可分享
微信分享提示