为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

linux 时间时区(Linux time zone)

2018-02-13 14页 doc 37KB 97阅读

用户头像

is_212655

暂无简介

举报
linux 时间时区(Linux time zone)linux 时间时区(Linux time zone) linux 时间时区(Linux time zone) View / modify Linux time zone and time I. time zone 1. look at the current time zone Date -R 2. modify the setting time zone Methods (1) Tzselect The tzselect command is used to select the time zone. I...
linux 时间时区(Linux time zone)
linux 时间时区(Linux time zone) linux 时间时区(Linux time zone) View / modify Linux time zone and time I. time zone 1. look at the current time zone Date -R 2. modify the setting time zone Methods (1) Tzselect The tzselect command is used to select the time zone. It's important to note that tzselect just helps us display the selected time zone, and it doesn't actually work, that is to say, it just tells us how to set up the environment variable TZ. (TZ = Time (Zone) The tzselect program asks the user for information about the current location, and outputs the resulting time zone description to standard output. The output is suitable as a value for the TZ environment variable. All interaction with the user is done via standard input and standard error.) if you want to permanently change the time Zone, in accordance with the the tzselect command prompt information, set the correct TZ environment variables and derived in.Profile or /etc/profile. Another way to change the time zone is to change the system configuration file /etc/sysconfig/clock directly, and then modify the symbol to link the /etc/locatime file Methods (2) are limited to RedHat Linux and CentOS Timeconfig Method (3) applies to Debian Dpkg-reconfigure tzdata 3. copy the corresponding time zone file, replace the system time zone file, or create a link file CP /usr/share/zoneinfo/$/ $time primary time zone time zone /etc/localtime It can be used in china: CP /usr/share/zoneinfo/Asia/Shanghai /etc/localtime Two, time 1, check the time and date Date 2, set the time and date Set the system date to June 10, 1996 command Date -s 06/22/96 Set the system time to 1:52 p.m. 0 seconds Date -s 13:52:00 3. write the current time and date to BIOS to avoid failure after restart Hwclock -w Three, timing synchronization time * * * * * /usr/sbin/ntpdate 210.72.145.44 > /dev/null 2>&1 In Linux, commands for clock viewing and setting include date, hwclock, and clock. Among them, clock and hwclock use similar, only one will do, except clock command, in addition to supporting the x86 hardware system, but also support the Alpha hardware system. View Linux system time: Date Modify Linux system time: Date -s (followed by time) View Linux hardware time: Hwclock or Clock or Hwclock – show or Clock – show Modify Linux hardware time: Hwclock – set – date or Clock – set – date Synchronize the system time with the hardware clock: Hwclock – hctosys or Clock – hctosys Instead, synchronize the hardware clock with the system time: Hwclock – systohc or Clock – systohc Let the system synchronize the hardware time every ten minutes. [hqw@localhost root]$VI /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ run-parts # 01 * * * * root run-parts /etc/cron.hourly * * * root run-parts 024 /etc/cron.daily 224 /etc/cron.weekly 4241 run-parts 0 root * * * * root run-parts /etc/cron.monthly * */10 * * * root hwclock --hctosys # I joined this line, said every 10 minutes to perform a hwclock --hctosys. The tzselect command is used to select the time zone. It's important to note that tzselect just helps us display the selected time zone, and it doesn't actually work, that is to say, it just tells us how to set up the environment variable TZ. (TZ = Time (Zone) The tzselect program asks the user for information about the current location, and outputs the resulting time zone description to standard output. The output is suitable as a value for the TZ environment variable. All interaction with the user is done via standard input and standard error.) if you want to permanently change the time Zone, in accordance with the the tzselect command prompt information, set the correct TZ environment variables and derived in.Profile or /etc/profile. Another way to change the time zone is to change the system configuration file /etc/sysconfig/clock directly, and then modify the /etc/locatime file corresponding to the symbol link, see sample three. Common parameters No. Use example Example 1 change the time zone to Beijing [root@new55 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)西藏和新疆的大部分地区 5)西西藏和新疆 #,一 已提供以下信息: 中国 东中国-北京,广东,上海,等。 因此,TZ =亚细亚/上海将使用。 当地时间现在是:12月6日星期09:40:35 CST 2010。 通用现在时间是:12月6日星期01:40:35 UTC 2010。 以上信息可以吗, 1)是的 2)无 #,一 您可以通过添加该行使更改永久性。 TZ =亚细亚/上海出口TZ; 在主目录中的文件“配置文件”中,然后注销并再次登录。 这里是TZ值一次,这一次在输出上让你 可以使用/usr/bin/vi tzselect在shell脚本命令: 亚洲/上海 [根@ new55 ~ ] # 现在要做的事情就是按照提示,把TZ =亚细亚/上海;出口TZ添加 到。轮廓中(bash对应加到。bash_profile)。 示例二将时区更改为夏威夷 [根@ new55 ~ ] # tzselect 请确定一个位置,以便时区规则可以正确设置。 请选择一个大陆或海洋。 1)非洲 2)美洲 3)南极洲 4)北冰洋 5)亚洲 6)大西洋 7)澳大利亚 8)欧洲 9)印度洋 10)太半洋 11)没有我想使用POSIX TZ格式指定的时区。 #,二 请选择一个国家。 1)欧洲27)洪都拉斯 2)安提瓜和巴布达岛牙买加28) 3)阿根廷29)马提尼克 4)30)墨西哥阿鲁巴 5)巴哈马31)蒙特塞拉特 6)32)荷属安的列斯群岛巴巴多斯 7)伯利兹33)尼加拉瓜 8)玻利维亚34)巴拿马 9)巴西35)巴拉圭 10)加拿大36)秘鲁 11)37)波多黎各开曼群岛 12)智利38)ST缪 13)哥伦比亚39)圣基茨和尼维斯 14)哥斯达黎加40)圣露西亚 15)古巴41)圣马丁(法国部分) 16)多米尼加42)圣彼埃尔和密克隆岛 17)多米尼加共和国43)圣文森特 18)厄瓜多尔苏里南44) 19)萨尔瓦多45)特立尼达和多巴哥 20)法属圭亚那46)特克斯和凯科斯群岛 21)格陵兰47)美国 22)格林纳达48)乌拉圭 23)49)委内瑞拉瓜德罗普岛 24)瓜地马拉50)维尔京群岛(英国) 25)圭亚那51)维尔京群岛(美国) 26)海地 #,四十七 请选择下列时区之一。 1)东部时间 2)东部时间-密歇根-大部分地点 3)东部时间-肯塔基-路易斯维尔地区 4)东部时间-肯塔基-韦恩县 5)东部时间-印第安娜-大部分地点 6)东部时间-印第安娜-戴维斯、杜布瓦、诺克斯和马丁县 7)东部时间-印第安娜-珀拉斯凯县 8)东部时间-印第安娜-克劳福德县 9)东部时间-印第安娜-派克县 10)东部时间-印第安娜-瑞士县 11)中央时间 12)中央时间-印第安娜-佩里县 13)中部时间-印第安娜-斯塔克县 14)中部时间-密歇根-狄金森、戈吉比克、铁和梅诺米尼县 15)中央时间-北达科他州- Oliver County 16)中部时间-北达科他州莫尔顿县(除Mandan) 17)山区时间 18)山区时间-南爱达荷州和俄勒冈东部 19)山地时间-纳瓦霍语 20)山区标准时间-亚利桑那州 21)太平洋时间 22)阿拉斯加时间 23)阿拉斯加时间-阿拉斯加州 24)阿拉斯加时间阿拉斯加狭长的脖子 25)阿拉斯加时间-西阿拉斯加 26)阿留申群岛 27)夏威夷 #,二十七 已提供以下信息: 美国 夏威夷 因此,TZ = 'pacific /火奴鲁鲁将使用。 当地时间现在是:12月5日太阳16:37:02 HST 2010。 通用现在时间是:12月6日星期02:37:02 UTC 2010。 以上信息可以吗, 1)是的 2)无 #,一 您可以通过添加该行使更改永久性。 TZ = 'pacific /火奴鲁鲁出口TZ; 在主目录中的文件“配置文件”中,然后注销并再次登录。 这里是TZ值一次,这一次在标准输出上让你 可以使用/usr/bin/vi tzselect在shell脚本命令: 太平洋/火奴鲁鲁 [根@ new55 ~ ] # [根@ new55 ~ ] #猫/ etc / sysconfig /时钟 #带参数由系统配置日期只是评估。 #系统的时区是在/ etc /时间的内容定义。 区域=“亚洲/上海” UTC =真 弧= false [根@ new55 ~ ] # 注意:tzselect命令只告诉你选择的时区的写法,并不会生效所以现在它还是东8区北京时间。 [根@ new55 ~ ] #日期- R Mon,06 Dec 2010 10:46:11 + 0800 [根@ new55 ~ ] # [根@ new55 ~ ] # TZ = 'pacific /火奴鲁鲁出口TZ; [根@ new55 ~ ] #日期- R 太阳,05月2010日16:46:44 - 1000 [根@ new55 ~ ] # [根@ new55 ~ ] #退出 注销 重新登录TZ就没有了。 最后登录:12月6日星期09:39:30 2010 192.168.6.106 [根@ new55 ~ ] # echo TZ [根@ new55 ~ ] # Example three modifies the time zone by changing the configuration file [root@new55 cat /etc/sysconfig/clock ~]# The ZONE parameter is only evaluated # by system-config-date. Timezone of the system # The is defined by the contents of /etc/localtime. ZONE= "Asia/Shanghai"" UTC=true ARC=false [root@new55 ~]# Modify the Linux system time zone 1) modifiable /etc/sysconfig/clock ZONE=Asia/Shanghai (check the files below /usr/share/zoneinfo) UTC=false (hardware clock is UTC or GMT clock) ARC=false (if it is on the Alpha machine, then set to true) (the hardware clock is set to the benefit of UTC is that he can automatically set the daylight saving time, the disadvantage is that in the installation of multiple operating system startup machine, clock in another operating system will be wrong.) 2) rm /etc/localtime Zhy: is the file a symbolic link? If it is set up when the system is installed, it is a common file. 3) taking Shanghai as an example: Ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime JVM time zone adjustment in Websphere The problem of dealing with a Websphere time zone yesterday: Environmental Science: Operating system HP-UX upload websphere6.1+jvm1.5 (I tried several times JDK, it seems that only 1.5 of the problem will appear, I hope IBM people can test it) Problem: The log and timing tasks on the JSP were 8 hours ahead of schedule Write a program from the JSP page to directly obtain the time zone, the time zone is found GMT (Greenwich time), Beijing time is eight East area so just a difference of 8 hours, the analysis may be some configuration installation Websphere user environment variables did not choose Chinese, cause the system Chinese did not install the habit to install, but hope that IBM can do a little improvement, have been sold in the product is not to adjust the time zone! Say how to change the time zone (my Chinese interface): 1. landing console; 2. I choose the server application server server (-----> start here is the default Server1) ---------> process definition ----->java virtual machine ------> custom attributes; 3. select new 4. Name: user.timezone; The 5. value was Asia/Shanghai; 6. save; 7. restart service User.timezone can also be set to GMT+8 Yes, some environments don't recognize Asia/Shanghai, which can be directly set to GMT+8
/
本文档为【linux 时间时区(Linux time zone)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索