當前位置: 首頁>>代碼示例>>Java>>正文


Java DateUtils.isSameDay方法代碼示例

本文整理匯總了Java中org.apache.commons.lang3.time.DateUtils.isSameDay方法的典型用法代碼示例。如果您正苦於以下問題:Java DateUtils.isSameDay方法的具體用法?Java DateUtils.isSameDay怎麽用?Java DateUtils.isSameDay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.lang3.time.DateUtils的用法示例。


在下文中一共展示了DateUtils.isSameDay方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: moveToNextNotHoliday

import org.apache.commons.lang3.time.DateUtils; //導入方法依賴的package包/類
/**
 * Move the date to the next day that is not an holiday. No updated delta.
 */
private void moveToNextNotHoliday() {
	while (holidayCursor < holidays.size()) {
		final Date holiday = holidays.get(holidayCursor);
		if (holiday.getTime() > cursor.getTime()) {
			// The date is before the first known holiday
			break;
		}

		// Either it's an holiday, either we have to skip increase cursor
		holidayCursor++;
		if (DateUtils.isSameDay(holiday, cursor)) {
			// The date is an holiday, go to the next day 00:00 00.000
			moveToTomorrow();
		}
		// The holiday cursor is too old, advance it only
	}

	// All holidays are before this date
}
 
開發者ID:ligoj,項目名稱:plugin-bt,代碼行數:23,代碼來源:ComputationContext.java

示例2: moveForward

import org.apache.commons.lang3.time.DateUtils; //導入方法依賴的package包/類
/**
 * Compute time duration in milliseconds between last known (or initial date) and the given date.
 * 
 * @param end
 *            The end date for delta computation. This date should be after the last known one or will return
 *            <code>0</code>.
 * @return time duration in milliseconds between start and end date. The returned value is a positive number.
 */
public long moveForward(final Date end) {
	this.delta = 0;
	while (cursor.getTime() + cursorTime < end.getTime()) {
		// We need to move the cursors
		if (DateUtils.isSameDay(cursor, end)) {
			// We need to compute the elapsed ranges and hours within the same day
			computeDelayTodayToTime(getTime(end));
		} else {
			// Move to the end of this day
			computeDelayTodayToTime(DateUtils.MILLIS_PER_DAY);
		}
	}
	return delta;
}
 
開發者ID:ligoj,項目名稱:plugin-bt,代碼行數:23,代碼來源:ComputationContext.java

示例3: isSameDay

import org.apache.commons.lang3.time.DateUtils; //導入方法依賴的package包/類
/**
 * 判斷是不是同一天
 *
 * @param src
 * @param des
 * @return
 */
public static boolean isSameDay(Date src, Date des) {
    return DateUtils.isSameDay(src, des);
}
 
開發者ID:peng9627,項目名稱:hall,代碼行數:11,代碼來源:CoreDateUtils.java

示例4: isSameDay

import org.apache.commons.lang3.time.DateUtils; //導入方法依賴的package包/類
/**
 * @param date1 等待比較第一個時間
 * @param date2 等待比較第二個時間
 * @return 比較結果
 * @description 判斷兩個時間是否相同
 */
public static boolean isSameDay(Date date1, Date date2) {
    return DateUtils.isSameDay(date1, date2);
}
 
開發者ID:tong12580,項目名稱:OutsourcedProject,代碼行數:10,代碼來源:DateUtil.java

示例5: isSameDay

import org.apache.commons.lang3.time.DateUtils; //導入方法依賴的package包/類
/**
 * 是否同一天.
 * 
 * @see DateUtils#isSameDay(Date, Date)
 */
public static boolean isSameDay(@NotNull final Date date1, @NotNull final Date date2) {
	return DateUtils.isSameDay(date1, date2);
}
 
開發者ID:zhangjunfang,項目名稱:util,代碼行數:9,代碼來源:DateUtil.java


注:本文中的org.apache.commons.lang3.time.DateUtils.isSameDay方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。