本文整理汇总了Java中org.joda.time.DateTimeConstants.SECONDS_PER_DAY属性的典型用法代码示例。如果您正苦于以下问题:Java DateTimeConstants.SECONDS_PER_DAY属性的具体用法?Java DateTimeConstants.SECONDS_PER_DAY怎么用?Java DateTimeConstants.SECONDS_PER_DAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.joda.time.DateTimeConstants
的用法示例。
在下文中一共展示了DateTimeConstants.SECONDS_PER_DAY属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldScheduleInterveningRepeatJobWithoutEndDate
@Test
public void shouldScheduleInterveningRepeatJobWithoutEndDate() throws SchedulerException {
try {
fakeNow(newDateTime(2020, 7, 15, 10, 0, 0));
Map<String, Object> params = new HashMap<>();
params.put(MotechSchedulerService.JOB_ID_KEY, "job_id");
RepeatingSchedulableJob repeatJob = new RepeatingSchedulableJob(
new MotechEvent("test_event", params),
3,
DateTimeConstants.SECONDS_PER_DAY,
newDateTime(2020, 7, 13, 12, 0, 0),
null,
true);
repeatJob.setUseOriginalFireTimeAfterMisfire(false);
schedulerService.scheduleRepeatingJob(repeatJob);
List<DateTime> fireTimes = getFireTimes("test_event-job_id-repeat");
assertEquals(asList(
newDateTime(2020, 7, 15, 12, 0, 0),
newDateTime(2020, 7, 16, 12, 0, 0)),
fireTimes);
} finally {
stopFakingTime();
}
}
示例2: durationAsString
public static String durationAsString(double duration) {
long d = Double.valueOf(duration * DateTimeConstants.MILLIS_PER_SECOND).longValue();
long days = d / (DateTimeConstants.SECONDS_PER_DAY * DateTimeConstants.MILLIS_PER_SECOND);
long secs = d % (DateTimeConstants.SECONDS_PER_DAY * DateTimeConstants.MILLIS_PER_SECOND);
Period p = new Period(secs);
return "" + days + " d " + periodFormatter.print(p);
}