Get the days difference
432478
public static int daysDiff(Date earlierDate, Date laterDate) {
        if (earlierDate == null || laterDate == null) {
            return 0;
        }

        return (int) ((laterDate.getTime() / DAY_MILLIS) - (earlierDate.getTime() / DAY_MILLIS));
    }
919367
public int getDay()
    {
        Timestamp adjusted = this;
        if (this._offset != null) {
            if (this._offset.intValue() != 0) {
                adjusted = make_localtime();
            }
        }
        return adjusted._day;
    }
618428
private int diff360EIsda(final LocalDate start, final LocalDate end) {
        if (start.equals(end)) {
            return 0;
        }
        int dayStart = start.getDayOfMonth();
        int dayEnd = end.getDayOfMonth();
        if (start.getMonth().length(start.isLeapYear()) == dayStart) {
            dayStart = CalculatorConstants.MONTH_30_DAYS;
        }
        if (end.getMonth() != Month.FEBRUARY && end.getMonth().length(end.isLeapYear()) == dayEnd) {
            dayEnd = CalculatorConstants.MONTH_30_DAYS;
        }
        return (end.getYear() - start.getYear()) * CalculatorConstants.YEAR_360 + (end.getMonthValue() - start.getMonthValue()) * CalculatorConstants.MONTH_30_DAYS + dayEnd - dayStart;
    }
743559
public static Integer getDays(String days)
   {
      Integer result = null;
      if (days != null)
      {
         result = Integer.valueOf(Integer.parseInt(days, 2));
      }
      return (result);
   }
353652
function () {
        // days between midweek of this week and jan 4
        // (f.z() - f.N() + 1 + 3.5) - 3
        var midWeekDaysFromJan4 = f.z() - f.N() + 1.5;
        // 1 + number of weeks + rounded week
        return humanize.pad(1 + Math.floor(Math.abs(midWeekDaysFromJan4) / 7) + (midWeekDaysFromJan4 % 7 > 3.5 ? 1 : 0), 2, '0');
      }
612535
def diff(self, dt=None, abs=True):
        
        if dt is None:
            dt = self.today()

        return Period(self, Date(dt.year, dt.month, dt.day), absolute=abs)
1234589
def getDateFromToday(delta,strfmt='%Y%m%d'):
	
	return (dt.date.today() + dt.timedelta(delta)).strftime(strfmt)
470529
def get_day():
    """"""
    day = datetime.datetime.today().weekday()
    if len(sys.argv) == 3:
        if sys.argv[2] == "mon":
            day = 0
        elif sys.argv[2] == "tue":
            day = 1
        elif sys.argv[2] == "wed":
            day = 2
        elif sys.argv[2] == "thur":
            day = 3
        elif sys.argv[2] == "fri":
            day = 4
        else:
            day = 5
    if day > 4:
        print("There is no information about the menu today.")
        exit(5)
    return day
498524
function getMonthDays(timestamp = Date.now()) {
  const cursorDay = new Date(new Date(timestamp).setDate(1));
  const currentMonth = cursorDay.getMonth();
  const days = [];
  while (cursorDay.getMonth() === currentMonth) {
    days.push(cursorDay.getTime());
    cursorDay.setDate(cursorDay.getDate() + 1);
  }
  return days;
}
1043005
public CalendarDays plus(CalendarDays other) {

        return CalendarDays.of(Math.addExact(this.days, other.days));

    }
615232
public static int days(EvaluationContext ctx, Object endDate, Object startDate) {
        return datedif(ctx, startDate, endDate, "d");
    }
432626
function () {
        var day, hour, minute, second,
            gapTime = this._finishTime - ( this._beginTime += this.DELAY );

        if ( gapTime <= 0 ) {
            return {_gap: 0, day: 0, hour: 0, minute: 0, second: 0};
        } else {
            day = Math.floor( gapTime / 1000 / 60 / 60 / 24 );
            hour = Math.floor( gapTime / 1000 / 60 / 60 - (24 * day) );
            minute = Math.floor( gapTime / 1000 / 60 - (24 * 60 * day ) - (60 * hour) );
            second = Math.floor( gapTime / 1000 - (24 * 60 * 60 * day) - (60 * 60 * hour) - (60 * minute) );
            return {_gap: gapTime, day: day, hour: hour, minute: minute, second: second};
        }
    }
1025582
def get_leapdays(init_date, final_date):
    

    curr_date = init_date
    leap_days = 0

    while curr_date != final_date:

        if curr_date.month == 2 and curr_date.day == 29:
            leap_days += 1

        curr_date += datetime.timedelta(days=1)

    return datetime.timedelta(days=leap_days)
1174423
private int getDaysToNextMatch(WeekDay weekDay) {

        for (WeekDay wd : m_weekDays) {
            if (wd.compareTo(weekDay) > 0) {
                return wd.toInt() - weekDay.toInt();
            }
        }
        return (m_weekDays.iterator().next().toInt() + (m_interval * I_CmsSerialDateValue.NUM_OF_WEEKDAYS))
            - weekDay.toInt();
    }
530110
def date_elem(ind_days, ind_minutes):
    """"""
    def inner(seq):
        return nexrad_to_datetime(seq[ind_days], seq[ind_minutes] * 60 * 1000)
    return inner
1154390
function diff (from, to, term) {
  term = (term || 'day').toLowerCase();
  var t, f;
  switch(TERM[term]) {
  case 'y':
    return this.getAge(from, to);
  case 'm':
    f = this.toDate(from);
    t = this.toDate(to);
    if (!(f && t)) {
      return null;
    }
    return (t.getFullYear() - f.getFullYear()) * 12 + t.getMonth() - f.getMonth() -
      (t.getDate() < f.getDate() ? 0 : 1);
  case 'w':
    f = this.toDate(from);
    t = this.toDate(to);
    return f && t ? parseInt((t - f) / A_WEEK, 10) : null;
  case 'd':
    f = this.toDate(from);
    t = this.toDate(to);
    return f && t ? (t - f) / A_DAY : null;
  case 'h':
    f = this.toDatetime(from);
    t = this.toDatetime(to);
    return f && t ? parseInt((t - f) / A_HOUR, 10) : null;
  case 'i':
    f = this.toDatetime(from);
    t = this.toDatetime(to);
    return f && t ? parseInt((t - f) / A_MINUTE, 10) : null;
  case 's':
    f = this.toDatetime(from);
    t = this.toDatetime(to);
    return f && t ? parseInt((t - f) / A_SECOND, 10) : null;
  case 'ms':
    f = this.toDatetime(from);
    t = this.toDatetime(to);
    return f && t ? t - f : null;
  default:
    return null;
  }
}
1267566
function (values, dates, rate) {
        var r = rate + 1;
        var result = values[0];
        for (var i = 1; i < values.length; i++) {
          result += values[i] / Math.pow(r, moment(dates[i]).diff(moment(dates[0]), 'days') / 365);
        }
        return result;
      }