Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set time zone and time in solaris9

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to set the time zone and time in solaris9. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

I. time zone

PRC is the name of the time zone, which corresponds to the PRC time zone file under / usr/share/lib/zoneinfo. CST is the abbreviation of Chinese Standard Time and is used in the output of the date command. It is defined in the PRC time zone file. You can see what's going on by looking at the asia file under / usr/share/lib/zoneinfo/src.

The way to set the time zone is to modify the TZ=xxx of the / etc/default/init file, and then you must restart .xxx to correspond to a file in / usr/share/lib/zoneinfo. CTT is the ID of Timezone, and CST is the short display name of Timezone. But the corresponding relationship between the short display name and ID is one-to-many, that is, ID that also uses the short display name CST and CST (this is ID), that is, Central Standard Time.

So Wed Aug 28 15:05:59 CST 2002 is correct, because the time zone is PRC, so the ID represented by the short name CST here is CTT.

Second, time

The system time can be modified without stopping the service, and can be modified after logging in with root users. Just use the date command to modify the time.

The format is: date mmddhhmmyyyy.ss, month, day, time, year. Seconds.

Pay attention to the format, you can modify it without adding parameters.

3. Linux and rhel modification time commands:

The "date-s" command is generally used to modify the system time. For example, the order to set the system time to July 26, 2010 is as follows.

# date-s 07Universe 26Universe 2010

The command to set the system time to 10:12:00 is as follows.

# date-s 10:12:00

When the system starts, the Linux operating system reads the time from CMOS to the system time variable, and the later modification time is realized by modifying the system time. In order to maintain the consistency between system time and CMOS time, Linux writes system time to CMOS at regular intervals. Since the synchronization takes place at regular intervals (about 11 minutes), if we restart the machine immediately after we execute date-s, the modification time may not be written to CMOS, which is the cause of the problem. If you want to ensure that the changes take effect, you can execute the following command.

# clock-w

This command forces the system time to be written to CMOS. The above is how to set the time zone and time in solaris9. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report