I'm currently working on an ESXI and want to get the date X day ago I have this command line working on other linux :
now=`date +"%Y/%m/%d"`
earlier=`date -d "$now -15 days" +%d/%m/%Y`
but when i try to use it on my esxi server the line :
earlier=`date -d "$now -15 days" +%d/%m/%Y`
is not working, i get the error
date: invalid date '2018/01/30 -4 days'
So I tried to write the date in differents way like american format but still have the error.
the esxi version is 6.0.0
I have searched on internet but i didn't find anything.
Can someone know what is the problem ? Thank you.
edit: for those having the same problem i got the solution in the comments below