devWonny 2021. 9. 3. 11:13
echo `date '\%Y-\%m-\%d' -d '3 day ago'`

date: the argument ‘\\%Y-\\%m-\\%d’ lacks a leading '+';
when using an option to specify date(s), any non-option
argument must be a format string beginning with '+'
Try 'date --help' for more information.​
echo `date '+\%Y-\%m-\%d' -d '3 day ago'`

\2021-\08-\31

 

echo "data now : $(date +%Y%m%d) "

data now : 20210903



echo "data now : `date +%Y-%m-%d` "

data now : 2021-09-03
date +'%m-%d-%Y'

09-03-2021