Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2908642
  • 博文数量: 412
  • 博客积分: 3010
  • 博客等级: 中校
  • 技术积分: 7374
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-25 15:15
个人简介

学习是一种信仰。

文章分类

全部博文(412)

文章存档

2014年(108)

2013年(250)

2010年(11)

2009年(43)

我的朋友

分类: AIX

2013-12-15 16:34:46

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。






阅读(24709) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~