查看GNU/Linux Tips的源代码
←
GNU/Linux Tips
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== Timezone == <source lang=bash> $ sudo timedatectl set-timezone Asia/Shanghai or: $ sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime or: $ sudo dpkg-reconfigure tzdata </source> date 获取时间,时区正确,但 cron 却把 crontab 里的时间配置认成 UTC 时间: <source lang=bash> root@tesla:~# cat /etc/timezone Asia/Shanghai root@tesla:~# cat /etc/localtime TZif2UTCTZif2UTC UTC0 root@tesla:~# timedatectl status Warning: Ignoring the TZ variable. Reading the system's time zone setting only. Local time: Mon 2025-12-22 02:55:43 UTC Universal time: Mon 2025-12-22 02:55:43 UTC RTC time: n/a Time zone: Asia/Shanghai (UTC, +0000) NTP enabled: no NTP synchronized: yes RTC in local TZ: no DST active: n/a root@tesla:~# cp /etc/localtime /etc/locltime-old root@tesla:~# rm /etc/localtime root@tesla:~# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime root@tesla:~# timedatectl status Warning: Ignoring the TZ variable. Reading the system's time zone setting only. Local time: Mon 2025-12-22 10:56:47 CST Universal time: Mon 2025-12-22 02:56:47 UTC RTC time: n/a Time zone: Asia/Shanghai (CST, +0800) ...... ...... </source> <br>
返回到
GNU/Linux Tips
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面