温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

debian如何更换时区

发布时间:2022-01-10 11:29:51 阅读:188 作者:柒染 栏目:开发技术
Debian服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

这篇文章主要为大家分析了debian如何更换时区的相关知识点,内容详细易懂,操作细节合理,具有一定参考价值。如果感兴趣的话,不妨跟着跟随小编一起来看看,下面跟着小编一起深入学习“debian如何更换时区”的知识吧。

一键更换到上海时区

echo "y" |cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
apt-get install -y ntpdate;ntpdate cn.pool.ntp.org
date
root@itsm:/backup# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord"or "TZ".
 1Africa
 2Americas
 3Antarctica
 4Arctic Ocean
 5Asia
 6Atlantic Ocean
 7Australia
 8Europe
 9Indian Ocean
10Pacific Ocean
11) coord - I want to use geographical coordinates.
12TZ - I want to specify the time zone using the Posix TZ format.
#? 5
Please select a country whose clocks agree with yours.
 1Afghanistan          18Israel            35Palestine
 2Armenia          19Japan            36Philippines
 3Azerbaijan          20Jordan            37Qatar
 4Bahrain          21Kazakhstan        38Russia
 5Bangladesh          22Korea (North)        39Saudi Arabia
 6Bhutan          23Korea (South)        40Singapore
 7Brunei          24Kuwait            41Sri Lanka
 8Cambodia          25Kyrgyzstan        42Syria
 9China          26Laos            43Taiwan
10Cyprus          27Lebanon            44Tajikistan
11East Timor          28Macau            45Thailand
12Georgia          29Malaysia            46Turkmenistan
13Hong Kong          30Mongolia            47United Arab Emirates
14India          31Myanmar (Burma)        48Uzbekistan
15Indonesia          32Nepal            49Vietnam
16Iran          33Oman            50Yemen
17Iraq          34Pakistan
#? 9
Please select one of the following time zone regions.
1Beijing Time
2Xinjiang Time
#? 1

The following information has been given:

    China
    Beijing Time

Therefore TZ='Asia/Shanghai' will be used.
Local time is now:    Tue Apr  5 13:26:14 CST 2016.
Universal Time is now:    Tue Apr  5 05:26:14 UTC 2016.
Is the above information OK?
1Yes
2No
#? 1

You can make this change permanent for yourself by appending the line
    TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai


root@itsm:/backup# TZ='Asia/Shanghai'; export TZ
root@itsm:/backup
root@itsm:/backup
root@itsm:/backup# date
Tue Apr  5 13:27:04 CST 2016


root@itsm:/backup# apt-get install ntpdate
root@itsm:/backup# ntpdate cn.pool.ntp.org

这篇文章主要为大家分析了debian如何更换时区的相关知识点,内容详细易懂,操作细节合理,具有一定参考价值。如果感兴趣的话,不妨跟着跟随小编一起来看看,下面跟着小编一起深入学习“debian如何更换时区”的知识吧。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×