1.linux os
昨天的命令是:
yesterdayformat=`date --date='yesterday' "+%Y-%m-%d_%H:%M:%S"`
echo $yesterdayformat
e.g.
[oracle@rac2 ~]$ yesterdayformat=`date --date='yesterday' "+%Y-%m-%d_%H:%M:%S"`
[oracle@rac2 ~]$ echo $yesterdayformat
2009-05-10_16:45:01
明天的命令是:
tomorrowformat=`date --date='tomorrow' "+%Y-%m-%d_%H:%M:%S"`
echo $tomorrowformat
e.g.
[oracle@rac2 ~]$ tomorrowformat=`date --date='tomorrow' "+%Y-%m-%d_%H:%M:%S"`
[oracle@rac2 ~]$ echo $tomorrowformat
2009-05-12_16:45:40
2.unix os
很复杂
参考文献:http://www.diybl.com/course/6_system/linux/Linuxjs/20090308/159826.html
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9252210/viewspace-594763/ ,如需转载,请注明出处,否则将追究法律责任。