1 import time 2 3 date = time.localtime() 4 year, month, day = date[:3] 5 day_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] 6 7 if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0): 8 day_month[1] = 29 9 if month == 1: 10 print(day) 11 else: 12 print(sum(day_month[:month - 1]) + day) 13