Returns a date representing the end of this duration from the specified start date.
@param start the date to start the duration
@return the end of the duration as a date
540433
public final Date getTime(final Date start) {
        final Calendar cal;
        if (start instanceof net.fortuna.ical4j.model.Date) {
            cal = Dates.getCalendarInstance((net.fortuna.ical4j.model.Date)start);
        } else {
            cal = Calendar.getInstance();
        }

        cal.setTime(start);
        if (isNegative()) {
            cal.add(Calendar.WEEK_OF_YEAR, -weeks);
            cal.add(Calendar.DAY_OF_WEEK, -days);
            cal.add(Calendar.HOUR_OF_DAY, -hours);
            cal.add(Calendar.MINUTE, -minutes);
            cal.add(Calendar.SECOND, -seconds);
        }
        else {
            cal.add(Calendar.WEEK_OF_YEAR, weeks);
            cal.add(Calendar.DAY_OF_WEEK, days);
            cal.add(Calendar.HOUR_OF_DAY, hours);
            cal.add(Calendar.MINUTE, minutes);
            cal.add(Calendar.SECOND, seconds);
        }
        return cal.getTime();
    }
1098988
public static int getMonthSpan(Date begin, Date end) {
        Calendar beginCal = new GregorianCalendar();
        beginCal.setTime(begin);
        Calendar endCal = new GregorianCalendar();
        endCal.setTime(end);
        int m = (endCal.get(Calendar.MONTH)) - (beginCal.get(Calendar.MONTH));
        int y = (endCal.get(Calendar.YEAR)) - (beginCal.get(Calendar.YEAR));
        return y * 12 + m;
    }
316452
@Override
  public long getDuration() {
    final long end = running.get() ? System.nanoTime() : endTime.get();
    return end - startTime.get();
  }
928489
public Query range(String start, String end) {
    return range(wrapKey(start), wrapKey(end));
  }
507995
public static long getTwoDaysBetweenNumber(String startDate, String endDate, Format format) {
        SimpleDateFormat localFormat = (SimpleDateFormat) format;
        long day = 0;
        try {
            java.util.Date startDay = localFormat.parse(startDate);
            java.util.Date endDay = localFormat.parse(endDate);
            day = (endDay.getTime() - startDay.getTime()) / (24 * 60 * 60 * 1000);
        } catch (Exception e) {
            return 0;
        }
        return day;
    }
852
public Date getStartDate()
   {
      Date result = (Date) getCachedValue(ProjectField.START_DATE);
      if (result == null)
      {
         result = getParentFile().getStartDate();
      }
      return (result);
   }
1370943
public List<UserCumulative> getUserCumulative(Date start, Date end) {
        if(diffThan6Days(start, end)) {
            throw new IllegalArgumentException("start和end相差不能超过6天以上");
        }

        String url = WxEndpoint.get("url.stats.user.cumulative");
        String json = "{\"begin_date\":\"%s\",\"end_date\":\"%s\"}";

        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String body = String.format(json, dateFormat.format(start), dateFormat.format(end));
        logger.debug("stats: get user summary: {}", body);
        String response = wxClient.post(url, body);
        UserCumulativeWrapper userCumulativeWrapper = JsonMapper.defaultMapper().fromJson(response, UserCumulativeWrapper.class);
        return userCumulativeWrapper.getList();
    }
320890
public static long getSecondsDifference(Date startDate, Date endDate) {
		long startTime = startDate.getTime();
		long endTime = endDate.getTime();
		long diffTime = endTime - startTime;
		long diffInSeconds = TimeUnit.MILLISECONDS.toSeconds(diffTime);
		return diffInSeconds;
	}
68564
def duration(self):
        
        if not self.started:
            return None
        start = self.started
        end = self.completed
        if not end:
            end = datetime.utcnow()
        return end - start
357675
public LocalDateTime getStartDateTime() {
        if (startDateTime == null) {
            startDateTime = LocalDateTime.of(getStartDate(), getStartTime());
        }

        return startDateTime;
    }
646088
public SearchParams between(final Date start, final Date end) {
        return this.creationGte(start).creationLte(end);
    }
927631
def end_date(self) -> Optional[datetime.date]:
        
        if not self.intervals:
            return None
        return self.end_datetime().date()
184524
public static Date beginOfHour(@NotNull final Date date) {
		return DateUtils.truncate(date, Calendar.HOUR_OF_DAY);
	}
148082
public Calendar getStartOfDay(long time) {

        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(time);
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        Calendar result = Calendar.getInstance();
        result.set(Calendar.YEAR, year);
        result.set(Calendar.MONTH, month);
        result.set(Calendar.DAY_OF_MONTH, day);
        return result;
    }
394255
public com.google.api.ads.admanager.axis.v201808.DateTime getEndTime() {
        return endTime;
    }
881157
public static Date getEndOfWeek(Date date) {

        if (date == null)
            return null;

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.setFirstDayOfWeek(FIRST_DAY_OF_WEEK);
        calendar.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);

        return calendar.getTime();
    }
27206
public LocalDateTime getEndDateTime() {
        if (endDateTime == null) {
            endDateTime = LocalDateTime.of(getEndDate(), getEndTime());
        }

        return endDateTime;
    }