Fixed minor issue in lastnmonth function

date format should be fine for the day variable