org.joda.time.LocalDateTime.plusMinutes()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中org.joda.time.LocalDateTime.plusMinutes()方法的一些代码示例,展示了LocalDateTime.plusMinutes()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LocalDateTime.plusMinutes()方法的具体详情如下:
包路径:org.joda.time.LocalDateTime
类名称:LocalDateTime
方法名:plusMinutes

LocalDateTime.plusMinutes介绍

[英]Returns a copy of this datetime plus the specified number of minutes.

This LocalDateTime instance is immutable and unaffected by this method call.

The following three lines are identical in effect:

LocalDateTime added = dt.plusMinutes(6); 
LocalDateTime added = dt.plus(Period.minutes(6)); 
LocalDateTime added = dt.withFieldAdded(DurationFieldType.minutes(), 6);

[中]返回此datetime加上指定分钟数的副本。
此LocalDateTime实例是不可变的,不受此方法调用的影响。
以下三行实际上是相同的:

LocalDateTime added = dt.plusMinutes(6); 
LocalDateTime added = dt.plus(Period.minutes(6)); 
LocalDateTime added = dt.withFieldAdded(DurationFieldType.minutes(), 6);

代码示例

代码示例来源:origin: com.synaptix/SynaptixWidget

break;
case 'm':
  dateTime = dateTime.plusMinutes(nb);
  break;
case 's':

代码示例来源:origin: effektif/effektif

@Test
public void testIn5Minutes() {
 LocalDateTime base = new LocalDateTime(2015, 12, 28, 9, 0, 0, 0);
 LocalDateTime absoluteTime = RelativeTime.minutes(5).resolve(base);
 assertEquals(base.plusMinutes(5), absoluteTime);
}

代码示例来源:origin: effektif/effektif

@Test
public void testJobFailAndRecover() throws Exception {
 jobService.saveJob(new Job()
  .jobType(new TestJob())
  .dueDate(Time.now()));
 
 TestJob.throwException = true;
 
 assertEquals(0, TestJob.jobExecutions.size());
 checkJobs();
 assertEquals(1, TestJob.jobExecutions.size());
 
 assertTrue(TestJob.jobExecutions.get(0).error);
 assertNull(TestJob.jobExecutions.get(0).job.done);
 // the default retry reschedule is 3 seconds
 Time.now = new LocalDateTime().plusMinutes(10);
 TestJob.throwException = false;
 
 checkJobs();
 assertEquals(2, TestJob.jobExecutions.size());
 
 assertNull(TestJob.jobExecutions.get(1).error);
 assertNotNull(TestJob.jobExecutions.get(1).job.done);
}

相关文章