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

x33g5p2x  于2022-01-17 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(399)

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

DateTime.isAfterNow介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

@Override
 public boolean apply(TimestampedDatasetVersion version) {
  return version.getDateTime()
    .plus(SelectBetweenTimeBasedPolicy.this.maxLookBackPeriod.or(new Period(DateTime.now().getMillis())))
    .isAfterNow()
    && version.getDateTime().plus(SelectBetweenTimeBasedPolicy.this.minLookBackPeriod.or(new Period(0)))
      .isBeforeNow();
 }
};

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

private long calculateNextCheckTime() {
 DateTime date = new DateTime(this.nextCheckTime).withZone(this.timezone);
 int count = 0;
 while (!date.isAfterNow()) {
  if (count > 100000) {
   throw new IllegalStateException(
     "100000 increments of period did not get to present time.");
  }
  if (this.period == null && this.cronExpression == null) {
   break;
  } else if (this.cronExecutionTime != null) {
   final Date nextDate = this.cronExecutionTime.getNextValidTimeAfter(date.toDate());
   // Some Cron Expressions possibly do not have follow-up occurrences
   if (nextDate != null) {
    date = new DateTime(nextDate);
   } else {
    break;
   }
  } else {
   date = date.plus(this.period);
  }
  count += 1;
 }
 return date.getMillis();
}

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

public boolean updateTime() {
 if (new DateTime(this.nextExecTime).isAfterNow()) {
  return true;
 }
 if (this.cronExpression != null) {
  final DateTime nextTime = getNextCronRuntime(
    this.nextExecTime, this.timezone, Utils.parseCronExpression(this.cronExpression,
      this.timezone));
  this.nextExecTime = nextTime.getMillis();
  return true;
 }
 if (this.period != null) {
  final DateTime nextTime = getNextRuntime(this.nextExecTime, this.timezone, this.period);
  this.nextExecTime = nextTime.getMillis();
  return true;
 }
 return false;
}

代码示例来源:origin: apache/incubator-druid

.isAfterNow();

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

DateTime expirationDate = new DateTime(Integer.parseInt("20" + expYear), Integer.parseInt(expMonth), 1, 0, 0);
  expirationDate = expirationDate.dayOfMonth().withMaximumValue();
  validDate = expirationDate.isAfterNow();
  validDateFormat = true;
} catch (Exception e) {

代码示例来源:origin: ihaolin/antares

/**
 * 日期a是否大于当前日期
 * @param a 日期a
 * @return 大于返回true,反之false
 */
public static Boolean isAfterNow(Date a){
  return new DateTime(a).isAfterNow();
}

代码示例来源:origin: me.hao0/common

/**
 * 日期a是否大于当前日期
 * @param a 日期a
 * @return 大于返回true,反之false
 */
public static Boolean isAfterNow(Date a){
  return new DateTime(a).isAfterNow();
}

代码示例来源:origin: FenixEdu/fenixedu-academic

public static boolean validateResponse(HttpSession session, String value) {
  if (session == null || Strings.isNullOrEmpty(value)) {
    return false;
  }
  KaptchaSession key = (KaptchaSession) session.getAttribute(KAPTCHA_SESSION_KEY);
  return key != null && key.value.equals(value) && key.creation.plusMinutes(5).isAfterNow();
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-data-management

@Override
 public boolean apply(TimestampedDatasetVersion version) {
  return version.getDateTime()
    .plus(SelectBetweenTimeBasedPolicy.this.maxLookBackPeriod.or(new Period(DateTime.now().getMillis())))
    .isAfterNow()
    && version.getDateTime().plus(SelectBetweenTimeBasedPolicy.this.minLookBackPeriod.or(new Period(0)))
      .isBeforeNow();
 }
};

代码示例来源:origin: io.nflow/nflow-engine

public boolean tick() {
 if (nextUpdate.isAfterNow()) {
  return false;
 }
 nextUpdate = now().plusSeconds(keepaliveIntervalSeconds);
 updateActiveTimestamp();
 return true;
}

代码示例来源:origin: org.openhab.binding/org.openhab.binding.caldav-personal

private List<CalDavEvent> getActiveEvents(List<CalDavEvent> events) {
  List<CalDavEvent> subList = new ArrayList<CalDavEvent>();
  for (CalDavEvent event : events) {
    if (!(event.getStart().isBeforeNow()
        && event.getEnd().isAfterNow())) {
      continue;
    }
    subList.add(event);
  }
  return subList;
}

代码示例来源:origin: org.motechproject/motech-scheduler

private String getJobActivity(JobKey jobKey) throws SchedulerException {
  Trigger trigger = scheduler.getTriggersOfJob(jobKey).get(0);
  DateTime startDateTime = new DateTime(trigger.getStartTime());
  DateTime endDateTime = new DateTime(trigger.getEndTime());
  if (startDateTime.isAfterNow()) {
    return JobBasicInfo.ACTIVITY_NOTSTARTED;
  } else if (endDateTime.isBeforeNow()) {
    return  JobBasicInfo.ACTIVITY_FINISHED;
  } else {
    return JobBasicInfo.ACTIVITY_ACTIVE;
  }
}

代码示例来源:origin: com.nitorcreations/nflow-engine

public void tick() {
 if (nextUpdate.isAfterNow()) {
  return;
 }
 nextUpdate = now().plusSeconds(keepaliveIntervalSeconds);
 updateActiveTimestamp();
 recoverWorkflowInstancesFromDeadNodes();
}

代码示例来源:origin: org.dataconservancy.frontend/dcs-ui-services-impl

private List<PasswordResetRequest> findActiveRequestsForUser(Person user){
  List<PasswordResetRequest> userRequests = new ArrayList<PasswordResetRequest>();
  for(PasswordResetRequest request : passwordResetRequestDAO.list()){
    if(request.getUserEmailAddress().equals(user.getEmailAddress()) &&
        request.getRequestDate().plusHours(passwordResetRequestWindow).isAfterNow() ){
      userRequests.add(request);
     }
  }
  return userRequests;
}

代码示例来源:origin: FenixEdu/fenixedu-academic

public static InstitutionPhdCandidacyPeriod readNextCandidacyPeriod() {
  List<PhdCandidacyPeriod> readOrderedPhdCandidacyPeriods = readOrderedPhdCandidacyPeriods();
  for (PhdCandidacyPeriod phdCandidacyPeriod : readOrderedPhdCandidacyPeriods) {
    if (!phdCandidacyPeriod.isInstitutionCandidacyPeriod()) {
      continue;
    }
    if (phdCandidacyPeriod.getStart().isAfterNow()) {
      return (InstitutionPhdCandidacyPeriod) phdCandidacyPeriod;
    }
  }
  return null;
}

代码示例来源:origin: FenixEdu/fenixedu-academic

private boolean validUnEnrollment() {
  if (this.getEnrollmentEndDay() != null && this.getEnrollmentEndTime() != null) {
    DateTime enrolmentEnd = createDate(this.getEnrollmentEndDayDate(), this.getEnrollmentEndTimeDate());
    if (enrolmentEnd.isAfterNow()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.kuali.kpme/kpme-tk-lm-impl

public boolean isOnCurrentPeriod() {
  boolean isOnCurrentPeriod = false;
  
  if (getCalendarEntry() != null) {
    DateTime beginPeriodDateTime = getCalendarEntry().getBeginPeriodFullDateTime();
    DateTime endPeriodDateTime = getCalendarEntry().getEndPeriodFullDateTime();
    isOnCurrentPeriod = (beginPeriodDateTime.isEqualNow() || beginPeriodDateTime.isBeforeNow()) && endPeriodDateTime.isAfterNow();
  }
  
  return isOnCurrentPeriod;
}

代码示例来源:origin: org.kuali.kpme/kpme-tk-lm-impl

public boolean isOnCurrentPeriod() {
  boolean isOnCurrentPeriod = false;
  
  if (getCalendarEntry() != null) {
    DateTime beginPeriodDateTime = getCalendarEntry().getBeginPeriodFullDateTime();
    DateTime endPeriodDateTime = getCalendarEntry().getEndPeriodFullDateTime();
    isOnCurrentPeriod = (beginPeriodDateTime.isEqualNow() || beginPeriodDateTime.isBeforeNow()) && endPeriodDateTime.isAfterNow();
  }
  
  return isOnCurrentPeriod;
}

代码示例来源:origin: FenixEdu/fenixedu-academic

public DateMidnight getThisMonday() {
  final DateTime beginningOfSemester = getBeginDateYearMonthDay().toDateTimeAtMidnight();
  final DateTime endOfSemester = getEndDateYearMonthDay().toDateTimeAtMidnight();
  if (beginningOfSemester.isAfterNow() || endOfSemester.isBeforeNow()) {
    return null;
  }
  final DateMidnight now = new DateMidnight();
  return now.withField(DateTimeFieldType.dayOfWeek(), 1);
}

代码示例来源:origin: FenixEdu/fenixedu-academic

public boolean isInEnrolmentPeriod() {
  if (this.getEnrollmentBeginDayDate() == null || this.getEnrollmentBeginTimeDate() == null
      || this.getEnrollmentEndDayDate() == null || this.getEnrollmentEndTimeDate() == null) {
    throw new DomainException("error.enrolmentPeriodNotDefined");
  }
  final DateTime enrolmentBeginDate = createDate(this.getEnrollmentBeginDayDate(), this.getEnrollmentBeginTimeDate());
  final DateTime enrolmentEndDate = createDate(this.getEnrollmentEndDayDate(), this.getEnrollmentEndTimeDate());
  return enrolmentBeginDate.isBeforeNow() && enrolmentEndDate.isAfterNow();
}

相关文章

DateTime类方法