昨天一同事随口问我,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).