当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 修改时区失败,求大神帮助
帖子发表于 : 2016-04-08 14:28 

注册: 2016-04-08 14:15
帖子: 2
系统: windows
送出感谢: 1
接收感谢: 0 次
lab@ubuntu:~$ date
Fri Apr 8 01:24:38 CDT 2016 ##这是当前时间
lab@ubuntu:~$ ls /etc/localtime -l
lrwxrwxrwx 1 root root 35 Apr 8 01:24 /etc/localtime -> /usr/share/zoneinfo/America/Chicago ##当前时区Chicago
lab@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ##修改时区为Shanghai
[sudo] password for lab:
lab@ubuntu:~$ ls /etc/localtime -l
lrwxrwxrwx 1 root root 35 Apr 8 14:24 /etc/localtime -> /usr/share/zoneinfo/America/Chicago ##时区未改变
lab@ubuntu:~$ date
Fri Apr 8 14:25:59 CST 2016 ##时间改变了
附件有图,时间改过来了,但是/etc/localtime没有改过来,桌面的右上角的时间及时区也没有改过来。请问为什么


附件:
文件注释: 操作截图
clipboard.png
clipboard.png [ 110.67 KiB | 被浏览 703 次 ]

页首
 用户资料  
 
2 楼 
 文章标题 : Re: 修改时区失败,求大神帮助
帖子发表于 : 2016-04-08 14:43 
头像

注册: 2011-03-20 13:12
帖子: 4522
地址: 山东省寿光县
系统: Debian
送出感谢: 105
接收感谢: 997
saltyfish 写道:
lab@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ##修改时区为Shanghai
[请问为什么

/etc/localtime 必须是符号链接,所以不能用 cp,需要用 ln -sf
引用:
Because the timezone identifier is extracted from the symlink target name of /etc/localtime, this file may not be a normal file or hardlink.

参考 https://www.freedesktop.org/software/systemd/man/localtime.html


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户



_________________
评价: 3.7% saltyfish
 
页首
 用户资料  
 
3 楼 
 文章标题 : Re: 修改时区失败,求大神帮助
帖子发表于 : 2016-04-11 8:36 

注册: 2016-04-08 14:15
帖子: 2
系统: windows
送出感谢: 1
接收感谢: 0 次
vickycq 写道:
saltyfish 写道:
lab@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ##修改时区为Shanghai
[请问为什么

/etc/localtime 必须是符号链接,所以不能用 cp,需要用 ln -sf
引用:
Because the timezone identifier is extracted from the symlink target name of /etc/localtime, this file may not be a normal file or hardlink.

参考 https://www.freedesktop.org/software/systemd/man/localtime.html



感谢!链接改过来了,但是桌面右上角的时间没有改变。


页首
 用户资料  
 
4 楼 
 文章标题 : Re: 修改时区失败,求大神帮助
帖子发表于 : 2016-04-12 20:48 
头像

注册: 2011-03-20 13:12
帖子: 4522
地址: 山东省寿光县
系统: Debian
送出感谢: 105
接收感谢: 997
saltyfish 写道:
链接改过来了,但是桌面右上角的时间没有改变。

执行 date 看看时间是否正确
若系统为 15.10,执行 timedatectl 将输出全部复制贴上来


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:Google [Bot] 和 0 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译