本文整理汇总了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
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}