def daysSince1970(self): # Add days between 1970 and current year (ignoring leap days) result = (self.mYear - 1970) * 365 # Add leap days between years result += utils.leapDaysSince1970(self.mYear - 1970) # Add days in current year up to current month (includes leap day for # current year as needed) result += utils.daysUptoMonth(self.mMonth, self.mYear) # Add days in month result += self.mDay - 1 return result
def getYearDay(self): return self.mDay + utils.daysUptoMonth(self.mMonth, self.mYear)