I want chang date time current to last month
ex
date
current date
YESTERDAY=`TZ=GMT date +%Y-%m-%d`; echo $YESTERDAY
2015-11-05
I want to
2015-10-05
chang last mount
sun can not use
QMONTH=`date +'%Y%m' -d 'last month'`
help me pls.
Thank you
you can:
a. install GNU coreutils package
b. install newer korn shell
@agent.kgb a. will indeed work but what makes you feel b. would help?
@jlliagre
$ echo ${.sh.version}
Version M 93t+ 2009-05-01
$ printf "%T\n" now
Fri Nov 6 10:47:33 CET 2015
$ printf "%T\n" yesterday
Thu Nov 5 00:00:00 CET 2015
$ printf "%T\n" "last month"
Thu Oct 1 00:00:00 CEST 2015
1 Like
Thanks for the tip !
That was deserving an explanation. I only checked if ksh provides a date builtin which it doesn't .