How to modify the time zone)

Source: Internet
Author: User
Tags time zones
How to modify the time zone-Linux Enterprise Application-Linux server application information is as follows. Most of the current cluster software requires a time difference of no more than 1000 seconds between multiple machines. Therefore, if you use the date command to modify the time, this is not much to say. However, sometimes the time of the two machines is the same, but the time zone is different, the user has to modify the time zone of the machine, which is different in different operating systems, the following describes how to change the time zone of mainstream operating systems:

Solaris:
In solaris, the/etc/TIMEZONE file needs to be modified to modify the time zone. TZ = PRC indicates the China time zone. We can replace it with TZ = US/Pacific and restart the machine, change the time zone to the US Pacific time zone.
Note the following three points:
1. On the X86 machine, run the following command to update the/etc/rtc_config file:
# Rtc-z zone-name (the zone-name here is the TZ value in/etc/TIMEZONE)
# Rtc-c
2. How many time zones can be selected? We can enter the/usr/share/lib/zoneinfo Directory, which contains many directories, including US and many files, such as PRC. This indicates that there are many time zones in US, the PRC is the unified time zone. That's why we see the two different forms of TZ = PRC and TZ = US/Pacific.
3. restart the system to make it take effect.

Linux (Redhat and Suse ):
1. query the name of the time zone to be changed in the/usr/share/zoneinfo/directory. The format of the change is the same as that
2. Remove the original localtime file;
# Mv/etc/localtime-old
3. Create a New localtime file and link the corresponding time zone file.
# Ln-s/usr/share/zoneinfo/Asia/Shanghai/etc/localtime
4. synchronize with hardware
#/Sbin/hwclock -- systohc

AIX:
1. view the current time zone (other operating systems use the date command)
Cat/etc/environment (find the row where TZ Is located)
2. We recommend that you use smit to modify the time zone for the sake of safety.
Smit chtz
3. All the time zone information is in the/usr/share/lib/zoneinfo directory.

HPUX:
1, # set_parms timezone. You can change the time zone in interactive mode.

For all Unix systems (excluding Linux), you can use echo $ TZ to view the current time zone.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.