本文整理汇总了Java中org.apache.commons.lang3.time.DateUtils.addMinutes方法的典型用法代码示例。如果您正苦于以下问题:Java DateUtils.addMinutes方法的具体用法?Java DateUtils.addMinutes怎么用?Java DateUtils.addMinutes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.time.DateUtils
的用法示例。
在下文中一共展示了DateUtils.addMinutes方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: subMinutes
import org.apache.commons.lang3.time.DateUtils; //导入方法依赖的package包/类
/**
* 减一分钟
*/
public static Date subMinutes(@NotNull final Date date, int amount) {
return DateUtils.addMinutes(date, -amount);
}
示例2: addMinutes
import org.apache.commons.lang3.time.DateUtils; //导入方法依赖的package包/类
/**
* 加一分钟
*/
public static Date addMinutes(@NotNull final Date date, int amount) {
return DateUtils.addMinutes(date, amount);
}
示例3: attendFailCauseRegistNotOpen
import org.apache.commons.lang3.time.DateUtils; //导入方法依赖的package包/类
@Test(expected = HttpClientErrorException.class)
@Transactional
public void attendFailCauseRegistNotOpen() {
Meeting meeting = meetingService.findById(user1MeetingId).get();
meeting.setMeetingStatus(Meeting.MeetingStatus.PUBLISHED);
Date minPlusOpenTime = DateUtils.addMinutes(Date.from(ZonedDateTime.now(ZoneOffset.UTC).toInstant()), 10);
meeting.setRegistOpenAt(minPlusOpenTime);
meetingAttendService.attend(meeting, baseDataTestHelper.getUser2());
}
示例4: attendFailCauseRegistClose
import org.apache.commons.lang3.time.DateUtils; //导入方法依赖的package包/类
@Test(expected = HttpClientErrorException.class)
@Transactional
public void attendFailCauseRegistClose() {
Meeting meeting = meetingService.findById(user1MeetingId).get();
meeting.setMeetingStatus(Meeting.MeetingStatus.PUBLISHED);
Date minPlusOpenTime = DateUtils.addMinutes(Date.from(ZonedDateTime.now(ZoneOffset.UTC).toInstant()), -10);
meeting.setRegistCloseAt(minPlusOpenTime);
meetingAttendService.attend(meeting, baseDataTestHelper.getUser2());
}
示例5: getDateRange
import org.apache.commons.lang3.time.DateUtils; //导入方法依赖的package包/类
private Range<Date> getDateRange() {
Date endDate = DateUtils.truncate(new Date(), Calendar.MINUTE);
Date startDate = DateUtils.addMinutes(endDate,
-YiDuConstants.yiduConf.getInt(YiDuConfig.SEND_SUBSCRIBE_INTEVAL, 15));
return Range.between(startDate, endDate);
}