Skip to content

Instantly share code, notes, and snippets.

@coffeant
Created June 3, 2015 01:55
Show Gist options
  • Save coffeant/f9423821ea6c32ed76f8 to your computer and use it in GitHub Desktop.
Save coffeant/f9423821ea6c32ed76f8 to your computer and use it in GitHub Desktop.
ubuntu modify date timezone to china shanghai
sudo tzconfig,如果命令不存在请使用 dpkg-reconfigure tzdata
然后按照提示选择 Asia对应的序号,选完后会显示一堆新的提示—输入城市名,如Shanghai或Chongqing,最后再用 sudo date -s “” 来修改本地时间
sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime 防止系统重启后时区改变
sudo apt-get install ntpdate
设置系统时间与网络时间同步 ntpdate cn.pool.ntp.org
将系统时间写入硬件时间 hwclock -w :systohc
@164479470
Copy link

谢谢大神的好帖子,我还是没有成功改变时间

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment