I am trying to increment date as follows (mac Catalina)
DATE=2019-01-01
NEXT_DATE=$(date +%m-%d-%Y -d "$DATE + 14 day")
but am getting date: illegal time format. How can I increment to the date?
In bash on Mac OS X, you can do like this:
date -j -v +14d -f "%Y-%m-%d" "2019-01-01" +%Y-%m-%d
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With