Convert datetime to Unix timestamp and convert it back in python,int(dt.strftime('%s'))