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

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

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

DateTime.secondOfDay介绍

[英]Get the second of day property which provides access to advanced functionality.
[中]获取第二天属性,该属性提供对高级功能的访问。

代码示例

代码示例来源:origin: org.kuali.rice/rice-core-api

private static boolean computeActive(DateTime activeFromDate, DateTime activeToDate, DateTime activeAsOfDate) {
  // the precision of this check should be to the second, not milliseconds, so we want to chop off any
  // milliseconds and do a ceiling of our seconds. Sometimes changes are made in near real time after a record
  // becomes activated or inactivated so we want to have the best result possible if they are still within the
  // same second, so we essentially always round up to ensure that this check will never fail in high throughput
  // environments
  activeAsOfDate = activeAsOfDate.secondOfDay().roundCeilingCopy();
  return (activeFromDate == null || activeAsOfDate.getMillis() >= activeFromDate.getMillis()) &&
      (activeToDate == null || activeAsOfDate.getMillis() < activeToDate.getMillis());
}

代码示例来源:origin: metatron-app/metatron-discovery

public DateTime maxDateTime(DateTime dateTime) {
 switch (this) {
  case YEAR:
   return dateTime.dayOfYear().withMaximumValue()
           .secondOfDay().withMaximumValue();
  case QUARTER:
   // TODO:
  case MONTH:
   return dateTime.dayOfMonth().withMaximumValue()
           .secondOfDay().withMaximumValue();
  case DAY:
   return dateTime.secondOfDay().withMaximumValue();
  case HOUR:
   return dateTime.minuteOfHour().withMaximumValue()
           .secondOfMinute().withMaximumValue();
  case MINUTE:
  case SECOND:
   return dateTime.secondOfMinute().withMaximumValue();
 }
 return dateTime;
}

代码示例来源:origin: net.thucydides/thucydides-core

private ProgressSnapshot createEndOfSeriesEntry(ProgressSnapshot latestSnapshot, Optional<Point> intersection) {
  return ProgressSnapshot.forRequirementType(latestSnapshot.getRequirementType())
      .atTime(latestSnapshot.getTime().plus(1).secondOfDay().getDateTime())
      .and(0).failed()
      .and(0).completed()
      .and(latestSnapshot.getCompleted()).estimated()
      .outOf(latestSnapshot.getTotal())
      .forBuild("ESTIMATED_DONE_DATE");
}

相关文章

DateTime类方法