centos在设置时区

centos在设置时区

大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。

[root@localhost ~]# date -R     // 查看时区

Mon, 19 May 2014 10:18:46 +0000

[root@localhost ~]# tzselect   // 设置改动时区

Please identify a location so that time zone rules can be set correctly.

Please select a continent or ocean.

 1) Africa

 2) Americas

 3) Antarctica

 4) Arctic Ocean

 5) Asia

 6) Atlantic Ocean

 7) Australia

 8) Europe

 9) Indian Ocean

10) Pacific Ocean

11) none – I want to specify the time zone using the Posix TZ format.

#? 5

Please select a country.

 1) Afghanistan   18) Israel     35) Palestine

 2) Armenia   19) Japan     36) Philippines

 3) Azerbaijan   20) Jordan     37) Qatar

 4) Bahrain   21) Kazakhstan     38) Russia

 5) Bangladesh   22) Korea (North)     39) Saudi Arabia

 6) Bhutan   23) Korea (South)     40) Singapore

 7) Brunei   24) Kuwait     41) Sri Lanka

 8) Cambodia   25) Kyrgyzstan     42) Syria

 9) China   26) Laos     43) Taiwan

10) Cyprus   27) Lebanon     44) Tajikistan

11) East Timor   28) Macau     45) Thailand

12) Georgia   29) Malaysia     46) Turkmenistan

13) Hong Kong   30) Mongolia     47) United Arab Emirates

14) India   31) Myanmar (Burma)     48) Uzbekistan

15) Indonesia   32) Nepal     49) Vietnam

16) Iran   33) Oman     50) Yemen

17) Iraq   34) Pakistan

#?

9

Please select one of the following time zone regions.

1) east China – Beijing, Guangdong, Shanghai, etc.

2) Heilongjiang (except Mohe), Jilin

3) central China – Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.

4) most of Tibet & Xinjiang

5) west Tibet & Xinjiang

#? 1

The following information has been given:

China

east China – Beijing, Guangdong, Shanghai, etc.

Therefore TZ=’Asia/Shanghai’ will be used.

Local time is now: Mon May 19 18:19:27 CST 2014.

Universal Time is now: Mon May 19 10:19:27 UTC 2014.

Is the above information OK?

1) Yes

2) No

#? 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@localhost ~]# date

Mon May 19 10:19:45 UTC 2014

[root@localhost ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  // 替换系统时区文件

cp: overwrite `/etc/localtime’? y

[root@localhost ~]# ntpdate time.windowscom

^[[A^C

[root@localhost ~]# ntpdate time.windows.com  // 同步时间

19 May 18:22:09 ntpdate[3400]: adjust time server 65.55.56.206 offset -0.286027 sec

[root@localhost ~]# date

Mon May 19 18:22:10 CST 2014

//參考: http://blog.163.com/zilichen0213@126/blog/static/17303755520118423614908/

版权声明:本文博主原创文章,博客,未经同意不得转载。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/116801.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • intellij idea 激活码 2021.5【在线注册码/序列号/破解码】[通俗易懂]

    intellij idea 激活码 2021.5【在线注册码/序列号/破解码】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月19日
    55
  • svn——’svn’不是内部或外部命令,也不是可运行的程序或批处理文件

    在安装svn工具后,我们一般会用客服端进行操作,但是也不会避免使用svn命令对项目进行操作。那么就有可能回遇到这个问题。’svn’ 不是内部或外部命令,也不是可运行的程序或批处理文件。下面是这个问题的解决方案:1、首先先看自己本地环境变量是否配置了,如下图是我的svn配置的路径:(不知道配置环境变量请自行百度)2、如果本地环境变量配置了,还是报这个错误,那么就是安装时候有个

    2022年2月24日
    67
  • 暴力破解带有密码的压缩文件

    暴力破解带有密码的压缩文件一暴力破解,就是不断生成新的密码去尝试能否破解成功。假如我们的密码位数为3位,其里面的值有可能是0或者1,其产生的密码集的数量为2的3次幂,也就是八个,然后一个一个去破解。而这生成这8个密码的过程就有一个递归规则存在。我们传入深度deep和对应字符串passwd两个参数,如果深度为1,直接输出字符串passwd,如果深度不为1,把深度deep减一,并把可能存在的字符串集合[0,1]遍历,添加…

    2022年5月7日
    112
  • vsftp用户名密码配置_win10ftp服务器设置用户名和密码

    vsftp用户名密码配置_win10ftp服务器设置用户名和密码huangyandong于2011-05-1013:06:11发表:打开vsftpd的配置文件,redhat的配置文件默认为/etc/vsftpd.conf:要想使用本地用户登录的话则只需更改下列选项local_enable改为YESchroot_local_user=YES#当设置为YES时,本地用户登录后就自动转到他们的用户主目录中去。#注意!:该选项用安全问题,特别是当用户有上传文…

    2022年9月1日
    6
  • 数据库的左右连接和内连接_数据库各种连接的区别

    数据库的左右连接和内连接_数据库各种连接的区别原英文文章链接:https://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins准备表A:–auto-generateddefinitionCREATETABLEtable_a(PKINT(10)NOTNULLPRIMARYKEY,Va…

    2026年1月27日
    4
  • 我的世界服务器指令大全电脑版_我的世界服务器专用指令

    我的世界服务器指令大全电脑版_我的世界服务器专用指令要成为一个合格的服主,熟悉我的世界服务器指令是必须的,服务器内指令的各种功能不仅是OP需要使用,还有部分是玩家也需要知道的,下面就看看小编为大家准备的我的世界服务器指令大全吧。【大全】我的世界服务器指令大全:首先/manuaddxxgm?如果要使用这个命令,需要自己先有权限在控制台输入manuaddxxadmin然后添加sethome权限manselect世界名字(默认world)输入m…

    2022年9月23日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号