Current month and year including previous month and year

By.

min read

My profile

Share this:

Curmonth like 2014/01
Lastmonth like 2013/12

[code:1:5c76638279]curmonth=$(date +%Y/%m)
echo “Curmonth ” $curmonth

lastmonth=$(date –date=”$(date +%Y-%m-15) -1 month” +’%Y/%m’)
echo “Lastmonth ” $lastmonth[/code:1:5c76638279]

Share this:

Leave a Reply

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