当前位置: 首页>>代码示例>>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;未经允许,请勿转载。