import time,datetime
from dateutil.relativedelta import relativedelta
time.mktime(time.strptime((datetime.today() + relativedelta(months=-5)) \
.strftime('%Y-%m-01 00:00:00'),"%Y-%m-%d %H:%M:%S"))
time.mktime((datetime.today() + relativedelta(months=-5)) \
.replace(day=1,hour=0,minute=0,second=0).timetuple())