Hi, Today is July 31st. I am trying to get the last month and the result is still 07 which is the current month. Also, the day for the last month is returned as '01'. This worked correctly yesterday, July 30th. So, I think that there is a bug running it on the last day of the month. Either that, I am doing something silly :-). But please check. [M1]->date +'%Y%m%d' 20140731 [M1]->date +'%Y%m%d' -d ' last month ' 20140701 [M1]->date +'%Y%m%d' -d ' 2 months ago ' 20140531 Thanks, Murali.