Aix 修改日期時間

wmlm發表於2008-09-24

昨天一同事隨口問我,AIX下如何修改時間?
第一反應就是讓我想起了原來在LINUX下做ORACLE RAC時,由於更改時間導致資料庫的問題,所以就說:"有點麻煩,要注意。"
實際上如果沒有資料庫RAC,修改是很簡單的,一是使用SMIT類圖形化介面smit date;二是使用date命令直接修改,在實際專案中,很少有更改系統時間的情況,因為安裝作業系統後,重要的一項就是核對設定系統時間,如果安裝作業系統不設定正確的時間和時區,那就有點應付了。也有小機在執行過程中,時鐘不正確的案例,遇到過HP的機器有這情況,原因連HP的支援也說不清楚。
js21-1 /#>date
Wed Sep 24 11:06:04 CDT 2008
js21-1 /#>date 09241115
Wed Sep 24 11:15:02 CDT 2008

MAN中的解釋如下:

[@more@]

Syntax

To Set the Date and Time as Root User
/usr/bin/date [ -n ] [ -u ] [ Date ] [ +FieldDescriptor ... ]
The following formats can be used when setting the date with the Date
parameter:
* mmddHHMM[YYyy]
* mmddHHMM[yy]

The variables to the Date parameter are defined as follows:
mm
Specifies the month number.
dd
Specifies the number of the day in the month.
HH
Specifies the hour in the day (using a 24-hour clock).
MM
Specifies the minute number.
YY
Specifies the first two digits of the year. Note: If you do not
specify the first two digits of the year, values in the range 69
to 99 refer to the twentieth century, 1969 to 1999 inclusive, and
values in the range 00 to 68 refer to years in the twenty-first
century, 2000 to 2068 inclusive.
yy
Specifies the last two digits of the year. Note: The date command
accepts a 4 digit year as input. For example, if a four-digit year
is specified, the date command tries to set the year to "YYyy" and
fails for values which are out of range (less than 1970 and
greater than 2037).

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-1010972/,如需轉載,請註明出處,否則將追究法律責任。

相關文章