我想从给定日期减去月份。
businessDate='2019-12-31' diff=1 busDate=$(date --date="$businessDate -$diff month" +%Y-%m-%d) echo "Date: $busDate"
此代码返回 2019-12-01 而不是 2019-11-30。有人可以建议一个解决方案来获得正确的日期吗?
linux bash shell
bash ×1
linux ×1
shell ×1