solaris date命令 1.获取系统当前时间: date ‘+%Y%m%d%H%M%S’ 年月日时分秒 例如:20070706110300 2.修改系统时间: 格式为date mmddHHMMYYYY.SS,即月日时分年.秒 sh脚本中将date执行的结果付给一个变量时,用以下方式: currdate=` date ‘+%Y%m%d%H%M%S’`,需要说明的是等号后面的date命令是用反引号引起来的。 文件: [HOLER]solaris date 命令.rar 大小: 3KB 下载: 下载 holer [email=holeryu@hotmail.com]holery...
by holeryu - Solaris文档中心 - 2007-07-06 11:15:07 阅读(1590) 回复(0)
Complete list of FORMAT control characters supported by date command FORMAT controls the output.It can be the combination of any one of the following: %% a literal % %a locale's abbreviated weekday name (e.g., Sun) %A locale's full weekday name (e.g., Sunday) %b locale's abbreviated month name (e.g., Jan) %B locale's full month name (e.g., January) %c locale's date and time (e.g., Thu Mar 3 ...
如何用date命令查询当前月份之前的2个月,例如用 “date +%Y%m”,查出的当前月份是200906,我想输出200904, 如果当前的月份是200901,我想输出200811
求几天前/后的日期 dateSTR小弟试了一下 有 date -d "+1day/month/year/week" date -d "-1day/month/year/week" date -d "+1year1month1day" #颠倒顺序也可 date -d "yesterday/tomorrow" 不知还有没有其它格式,大家列举一下 [ 本帖最后由 爱知 于 2008-7-27 20:08 编辑 ]
如何返回前一天的日期,以20080729的形式返回. 开始我是用的 today=`date "+%Y%m%d"` yesterday=`expr $today - 1` 这样如果8月1号的话肯定会有错. 大家指点一下