Home | History | Annotate | Download | only in python2.7

Lines Matching refs:year

148             # 2005-01-03 occurs before the first Monday of the year.  Otherwise
274 def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon):
275 """Calculate the Julian day based on the year, week of the year, and day of
276 the week, with week_start_day representing whether the week of the year
278 first_weekday = datetime_date(year, 1, 1).weekday()
285 # Need to watch out for a week 0 (when the first day of the year is not
330 year = None
349 year = int(found_dict['y'])
353 if year <= 68:
354 year += 2000
356 year += 1900
358 year = int(found_dict['Y'])
430 if year is None and month == 2 and day == 29:
431 year = 1904 # 1904 is first leap year of 20th century
433 elif year is None:
434 year = 1900
435 # If we know the week of the year and what day of that week, we can figure
436 # out the Julian day of the year.
439 julian = _calc_julian_from_U_or_W(year, week_of_year, weekday,
445 # Need to add 1 to result since first day of the year is 1, not 0.
446 julian = datetime_date(year, month, day).toordinal() - \
447 datetime_date(year, 1, 1).toordinal() + 1
450 datetime_result = datetime_date.fromordinal((julian - 1) + datetime_date(year, 1, 1).toordinal())
451 year = datetime_result.year
455 weekday = datetime_date(year, month, day).weekday()
457 # the caller didn't supply a year but asked for Feb 29th. We couldn't
460 year = 1900
462 return (time.struct_time((year, month, day,