def next_month(t):
 now = time.localtime(t)
 month = (now.tm_mon + 1)
 year = now.tm_year
 if (month > 12):
  month = 1
  year += 1
 ntime = (year, month, 1, 0, 0, 0, 0, 0, now[8])
 return time.mktime(ntime)

def next_month ( t ) : now = time . localtime ( t ) month = ( now . tm_mon + 1 ) year = now . tm_year if ( month > 12 ) : month = 1 year += 1 ntime = ( year , month , 1 , 0 , 0 , 0 , 0 , 0 , now [ 8 ] ) return time . mktime ( ntime )
return timestamp for start of next month .