不考虑时间求天数差

@param startDate 开始时间
@param endDate   结束时间
439790
public static long getDaysBetweenIgnoreTime(Date startDate, Date endDate) {
        startDate = getRoundedDay(startDate);
        endDate = getNextDay(endDate);
        return getBetweenDate(startDate, endDate);
    }
316110
public void start(final Date start) {
		if (start != null) {
			submit((System.currentTimeMillis() - start.getTime()) / 1000.0, true);
		}
	}
927158
public void setStartTime(final Date date) {

        if (!Objects.equals(m_model.getStart(), date)) {
            removeExceptionsOnChange(new Command() {

                public void execute() {

                    m_model.setStart(date);
                    setPatternDefaultValues(date);
                    valueChanged();
                }
            });
        }

    }
850682
public boolean insideRange(Date startDate, Date endDate) {
	Calendar c1 = Calendar.getInstance();
	Calendar c2 = Calendar.getInstance();
	c1.setTime(startDate);
	c2.setTime(endDate);
	return isInRange(c1, c2);
    }
976161
public static List<LocalDate> untilDays(String startDate, String endDate, String pattern) {
        return untilDays(parse(startDate, pattern), parse(endDate, pattern));
    }
148524
public static void isTimeZone(String beginTime, String endTime, String format) {
        DateUtil.parse(beginTime, format);
        DateUtil.parse(endTime, format);
        if (beginTime.compareTo(endTime) > 0) {
            throw new IllegalArgumentException("开始时间必须小于结束时间");
        }
    }
1345101
public GetUserReadResponse getUserRead(Date beginDate, Date endDate) {
        BeanUtil.requireNonNull(beginDate, "beginDate is null");
        BeanUtil.requireNonNull(endDate, "endDate is null");
        GetUserReadResponse response = null;
        String url = BASE_API_URL + "datacube/getuserread?access_token=#";
        Map<String, String> param = new HashMap<String, String>();
        param.put("begin_date", DATE_FORMAT.format(beginDate));
        param.put("end_date", DATE_FORMAT.format(endDate));
        String json = JSONUtil.toJson(param);
        BaseResponse r = executePost(url, json);
        String resultJson = isSuccess(r.getErrcode()) ? r.getErrmsg() : r.toJsonString();
        response = JSONUtil.toBean(resultJson, GetUserReadResponse.class);
        return response;
    }
1343265
public Date setStartDate(Date time)
    {
        try   {
            this.getTable().edit();
            this.getField("StartDateTime").setData(time);
            this.getTable().set(this);
            this.getTable().seek(null);    // Read this record
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        return this.getStartDate();
    }
43605
public static function inBetween( $startDate, $endDate, $date ) {

		$start 	= is_string( $startDate ) ? strtotime( $startDate ) : $startDate->getTimestamp();
		$end 	= is_string( $endDate ) ? strtotime( $endDate ) : $endDate->getTimestamp();
		$test 	= is_string( $date ) ? strtotime( $date ) : $date->getTimestamp();

		// Test in between start and end
		return ( ( $test >= $start ) && ( $test <= $end ) );
	}
518216
private function determineDateForPrefix($startDate, $endDate)
    {
        // The default date value should look like "*/*/*" after joining
        $dateParts = array_fill_keys(['Y', 'm', 'd'], self::PREFIX_WILDCARD);

        // Narrow down the date by replacing the WILDCARDs with values if they
        // are the same for the start and end date.
        if ($startDate && $endDate) {
            foreach ($dateParts as $key => &$value) {
                $candidateValue = date($key, $startDate);
                if ($candidateValue === date($key, $endDate)) {
                    $value = $candidateValue;
                } else {
                    break;
                }
            }
        }

        return join('/', $dateParts);
    }
371671
public static List<String> getDayListBetween2Day(String startDate, String endDate, Format format) {
        List<String> dayList = new ArrayList<String>();
        int dataNum = Integer.parseInt(getTwoDay2String(startDate, endDate, format));
        for (int i = 0; i < (dataNum + 1); i++) {
            String resultDate = getNextDay2String(startDate, String.valueOf(i), format);
            dayList.add(resultDate);
        }
        return dayList;
    }
574583
public function getLeads($startDate, $endDate, array $params = array())
    {
        $isValidStartDate = $this->utils->isSystemDatetime($startDate);
        $isValidEndDate = $this->utils->isSystemDatetime($endDate);
        if (!$isValidEndDate || !$isValidStartDate) {
            throw new InvalidArgumentException('Invalid params: Only system date has available YYYY-MM-DDD HH:II:SS');
        }

        if ($startDate > $endDate) {
            throw new InvalidArgumentException('Invalid params: start_date > end_date');
        }

        $isOutOfLimit = $this->utils->isOutOfLimit($startDate, $endDate, LeadAcademic::LIMIT_PERIOD);
        if ($isOutOfLimit) {
            throw new InvalidArgumentException('Invalid params: Period is too large. Available only ' . LeadAcademic::LIMIT_PERIOD);
        }

        $params['date_lbound'] = $startDate;
        $params['date_ubound'] = $endDate;

        $this->normalizeParams($params);
        $response = $this->execute('/', $params);
        $data = $this->normalize($response);
        return $data['leads'];
    }
53182
public boolean evaluateSprintLength(String startDate, String endDate, int maxKanbanIterationLength) {
		boolean sprintIndicator = false;
		Calendar startCalendar = Calendar.getInstance();
		Calendar endCalendar = Calendar.getInstance();

		if (!StringUtils.isAnyEmpty(startDate) && !StringUtils.isAnyEmpty(endDate)) {

			Date strDt = convertIntoDate(startDate.substring(0, 4) + "-" + startDate.substring(5, 7) + "-" + startDate.substring(8, 10), "yyyy-MM-dd" );
			Date endDt = convertIntoDate(endDate.substring(0, 4) + "-" + endDate.substring(5, 7) + "-" + endDate.substring(8, 10), "yyyy-MM-dd");

			if (strDt != null && endDate != null) {
				startCalendar.setTime(strDt);
				endCalendar.setTime(endDt);

				long diffMill = endCalendar.getTimeInMillis() - startCalendar.getTimeInMillis();
				long diffDays = TimeUnit.DAYS.convert(diffMill, TimeUnit.MILLISECONDS);

				if (diffDays <= maxKanbanIterationLength) {
					// Scrum-enough
					sprintIndicator = true;
				}
			}
		} else {
			// Default to kanban
			sprintIndicator = false;

		}

		return sprintIndicator;
	}
85687
public void setEndDate(com.google.api.ads.admanager.axis.v201902.Date endDate) {
        this.endDate = endDate;
    }
321724
@Override
	public double getDaycount(LocalDate startDate, LocalDate endDate) {
		if(startDate.isAfter(endDate)) {
			return -getDaycount(endDate,startDate);
		}

		int startDateDay 	= startDate.getDayOfMonth();
		int startDateMonth 	= startDate.getMonthValue();
		int startDateYear 	= startDate.getYear();

		int endDateDay 		= endDate.getDayOfMonth();
		int endDateMonth 	= endDate.getMonthValue();
		int endDateYear 	= endDate.getYear();


		// Check if we have last day of February
		boolean isStartDateLastDayOfFebruary = (startDateMonth == Month.FEBRUARY.getValue() && startDateDay == startDate.lengthOfMonth());
		boolean isEndDateLastDayOfFebruary = (endDateMonth == Month.FEBRUARY.getValue() && endDateDay == endDate.lengthOfMonth());

		// Last day of February and 31st of a month are both treated as "30".
		if(isStartDateLastDayOfFebruary || startDateDay == 31) {
			startDateDay = 30;
		}
		if((isEndDateLastDayOfFebruary && !isTreatEndDateAsTerminationDate) || endDateDay == 31) {
			endDateDay = 30;
		}

		return (endDateYear - startDateYear) * 360.0 + (endDateMonth - startDateMonth) * 30.0 + (endDateDay - Math.min(startDateDay, 30.0));
	}
310444
public void setDate(String date) {
        if (date == null || date.trim().isEmpty()) {
            throw new IllegalArgumentException("Date cannot be null or empty.");
        }
        try {
            Date dateToSet = new SimpleDateFormat("MM/dd/yyyy").parse(date);
            Calendar to = Calendar.getInstance();
            to.setTime(dateToSet);
            setDate(to);
        } catch (ParseException e) {
            throw new IllegalArgumentException(e);
        }
    }
184524
public static Date beginOfHour(@NotNull final Date date) {
		return DateUtils.truncate(date, Calendar.HOUR_OF_DAY);
	}