get day of year ( 1 - 365 )
553555
def yday
      day_of_year = 0

      (1..(@month-1)).to_a.each do |month|
        day_of_year += PDaysInMonth[month-1]
      end

      day_of_year += day

      day_of_year
    end
258139
def day(self, num):
        """"""
        d = date(self.year, 1, 4)  # The Jan 4th must be in week 1 according to ISO
        return d + timedelta(weeks=self.week-1, days=-d.weekday() + num)
474848
def AmericanDateToEpoch(self, date_str):
    """"""
    try:
      epoch = time.strptime(date_str, "%m/%d/%Y")
      return int(calendar.timegm(epoch)) * 1000000
    except ValueError:
      return 0
35482
def z(self):
    "'"
    doy = self.year_days[self.data.month] + self.data.day
    if self.L() and self.data.month > 2:
      doy += 1
    return doy
542210
private static String getDaysInMonthBound(int year, int month) {
	    Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
		cal.set(Calendar.YEAR, year);
	    cal.set(Calendar.MONTH, month);
		cal.set(Calendar.DAY_OF_MONTH, 1);
		return new Integer(cal.getActualMaximum(Calendar.DAY_OF_MONTH)).toString();
	}
303203
private static int getFirstCalendarWeekAsDayOfYear(int year) {

        Weekday wdNewYear =
            Weekday.valueOf(GregorianMath.getDayOfWeek(year, 1, 1));
        int dow = wdNewYear.getValue(Weekmodel.ISO);

        return (
            (dow <= 8 - Weekmodel.ISO.getMinimalDaysInFirstWeek())
            ? 2 - dow
            : 9 - dow
        );

    }
1029110
function getYearDay (date) {
  date = toStringDate(date)
  if (baseExports.isDate(date)) {
    return Math.floor((getYMDTime(date) - getYMDTime(getWhatYear(date, 0, STRING_FIRST))) / DAY_TIME) + 1
  }
  return date
}
323988
public static int getYearDay(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    }
1343359
def to_jd(year, week, day):
    ''''''
    return day + n_weeks(SUN, gregorian.to_jd(year - 1, 12, 28), week)
1332688
function (year) {
			var daysCount = 0;
			for (var i = 1; i <= 12; i++) {
				daysCount += this.daysInMonth(year, i);
			}
			return daysCount;
		}
738970
def get_day(self):
        
        year = super(BuildableDayArchiveView, self).get_year()
        month = super(BuildableDayArchiveView, self).get_month()
        day = super(BuildableDayArchiveView, self).get_day()
        fmt = self.get_day_format()
        dt = date(int(year), int(month), int(day))
        return dt.strftime(fmt)
750872
def day_of_year(dt):
        # type: (int) -> int
        """"""
        sec = time.mktime(dt.timetuple())
        t = time.localtime(sec)
        return t.tm_yday
776728
public function getDayOfYear() : int
    {
        return Month::of($this->month)->getFirstDayOfYear($this->isLeapYear()) + $this->day - 1;
    }
1335817
def from_year(cls, year):
        

        first_day = date(year, 1, 1)
        return cls.from_date(first_day, period="year")
619082
function getDayPeriods(localeData, dayPeriodsList) {
  const dayPeriods = localeData.main(`dates/calendars/gregorian/dayPeriods`);
  const result = {};
  // cleaning up unused keys
  Object.keys(dayPeriods).forEach(key1 => {          // format / stand-alone
    result[key1] = {};
    Object.keys(dayPeriods[key1]).forEach(key2 => {  // narrow / abbreviated / wide
      result[key1][key2] = {};
      Object.keys(dayPeriods[key1][key2]).forEach(key3 => {
        if (dayPeriodsList.indexOf(key3) !== -1) {
          result[key1][key2][key3] = dayPeriods[key1][key2][key3];
        }
      });
    });
  });

  return result;
}
302211
def to_jd(year, month, day):
    ''''''
    legal_date(year, month, day)
    gyear = year + YEAR_EPOCH - 1

    return (
        gregorian.EPOCH - 1 + (365 * (gyear - 1)) +
        floor((gyear - 1) / 4) + (-floor((gyear - 1) / 100)) +
        floor((gyear - 1) / 400) + (month - 1) * 28 + day
    )
610037
def _GetNumberOfDaysInCentury(self, year):
    
    if year < 0:
      raise ValueError('Year value out of bounds.')

    year, _ = divmod(year, 100)

    if self._IsLeapYear(year):
      return 36525
    return 36524