• Home
  • Raw
  • Download

Lines Matching full:year

3 # Date(month,day,year) returns a Date object.  An instance prints as,
22 # .year int or long int
30 # hand, at least this package knows that 2000 is a leap year but 2100
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))
80 def _date2num(date): # compute ordinal of date.month,day,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
95 n400 = (n-1)//_DI400Y # # of 400-year blocks preceding
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):