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


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

Leave a Reply

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