Bash gnu date (relative and today)

So this works if you have GNU date package (Ubuntu does):

date +%Y-%m-%d (returns date formatted as YYYY-MM-DD)

date +%Y-%m-%d -d “5 days ago” (returns date 5 days ago formatted as YYYY-MM-DD)

Leave a Reply

Your email address will not be published. Required fields are marked *