python date of the previous month
I am trying to get the date of the previous month with python. Here is what i’ve tried: str( time.strftime(‘%Y’) ) + str( int(time.strftime(‘%m’))-1 ) However, this way is bad for 2 reasons: First it returns 20122 for the February of 2012 (instead of 201202) and secondly it will return 0 instead of 12 on … Read more