Skip to content

How to get the first day of last month, and the last day of last month in bash

  • by


DATE_FROM=`date -d "-1 month -$(($(date +%d)-1)) days" "+%F"`
DATE_TO=`date -d "-$(($(date +%d)-1)) days" "+%F"`

Tags:

Leave a Reply

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