Lines Matching refs:year
62 def _is_leap(year): # 1 if leap year, else 0 argument
63 if year % 4 != 0: return 0
64 if year % 400 == 0: return 1
65 return year % 100 != 0
67 def _days_in_year(year): # number of days in year argument
68 return 365 + _is_leap(year)
70 def _days_before_year(year): # number of days before year argument
71 return year*365L + (year+3)//4 - (year+99)//100 + (year+399)//400
73 def _days_in_month(month, year): # number of days in month of year argument
74 if month == 2 and _is_leap(year): return 29
77 def _days_before_month(month, year): # number of days in year before month argument
78 return _DAYS_BEFORE_MONTH[month-1] + (month > 2 and _is_leap(year))
81 return _days_before_year(date.year) + \
82 _days_before_month(date.month, date.year) + \
92 del ans.ord, ans.month, ans.day, ans.year # un-initialize it
96 year, n = 400 * n400, n - _DI400Y * n400
102 year, n = year + more, int(n - dby)
104 try: year = int(year) # chop to int, if it fits
108 dbm = _days_before_month(month, year)
111 dbm = dbm - _days_in_month(month, year)
113 ans.month, ans.day, ans.year = month, n-dbm, year
121 def __init__(self, month, day, year): argument
124 dim = _days_in_month(month, year)
127 self.month, self.day, self.year = month, day, year
149 self.year)
222 (fd.month,fd.day,fd.year,ld.month,ld.day,ld.year):