搜索文章:

首页  |  Java技术  |  Asp.net  |  Asp编程  |  VC/C++  |  Delphi  |  VB编程

用date取昨天日期

计算昨天日期的bash例子

timestr="3 hours ago"

if [ $mode = "all" ]
then
if [ $# -ge 4 ]
then
curyear=
curmonth=
else
curyear=`date +%Y -d "$timestr"`
curmonth=`date +%m -d "$timestr"`
fi
subname=$curyear-$curmonth
else
if [ $# -ge 5 ]
then
curyear=
curmonth=
curday=
else
curyear=`date +%Y -d "$timestr"`
curmonth=`date +%m -d "$timestr"`
curday=`date +%d -d "$timestr"`
fi
subname=$curyear-$curmonth-$curday
fi
下一篇:yum apt redhat 7.3 >>
相关文章:
© 2006   www.java-asp.net