aix6.1 修改日期

date -n mmddHHMMYY,mm表示月分,dd表示日期,HH表示小时,MM表示分钟,YY表示年份。

date -n 0328165517报错不能修改

date -n 03281655 可以修改的

秒和年需要通过命令:

smitty date

修改

下面转的

linux下用date -s "20131215 09:02:25"把时间设为2013年12月15日9点2分25秒。
而aix呢?它不认-s这个参数:
date -n mmddHHMMYY,mm表示月分,dd表示日期,HH表示小时,MM表示分钟,YY表示年份。
如:date -n 1215090213表示把当前时间设为2013年12月15日9点2分,秒数无法修改。


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).


例如:
# date
Sun Dec 15 14:54:35 GMT+01:00 2013
# date 12150902


如果要修改秒数:
#smitty system (进入修改时间界面)
根据提示 选择 修改系统时间选项 回车
(英文版本的应该是:  选择"Change / Show Date and Time"回车,再选择"Change /Show Date & Time"回车)
------------------------------------------
年 (00-99)                                       [10]                     #YEAR
月 (01-12)                                       [12]                     #MONTH
日 (1-31)                                        [01]                     #DAY
时 (00-23)                                       [14]                     #HOUR
分 (00-59)                                       [11]                     #MINUTES 
秒 (00-59)                                       [38]                     #SECONDS
-------------------------------------------
把光标移动到 对应的[10],[12],[01],[14]上,然后输入想要修改的数字,按回车,OK。

猜你喜欢

转载自hui8080.iteye.com/blog/2366303
今日推荐