本文整理匯總了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);
}