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

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

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

LocalDate.toInterval介绍

[英]Converts this object to an Interval representing the whole day in the default time zone.

The interval may have more or less than 24 hours if this is a daylight savings cutover date.

This instance is immutable and unaffected by this method call.
[中]将此对象转换为表示默认时区中全天的间隔。
如果这是夏令时切换日期,则间隔可能大于或小于24小时。
此实例是不可变的,不受此方法调用的影响。

代码示例

代码示例来源:origin: joda-time/joda-time

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Converts this object to an Interval representing the whole day
 * in the default time zone.
 * <p>
 * The interval may have more or less than 24 hours if this is a daylight
 * savings cutover date.
 * <p>
 * This instance is immutable and unaffected by this method call.
 *
 * @return a interval over the day
 */
public Interval toInterval() {
  return toInterval(null);
}

代码示例来源:origin: org.incode.module.base/incode-module-base-dom

private static long toStartInstant(final LocalDate date) {
  if (date == null) {
    return MIN_VALUE;
  }
  return date.toInterval().getStartMillis();
}

代码示例来源:origin: org.incode.module.base/incode-module-base-dom

private static long toEndInstant(final LocalDate date) {
  if (date == null) {
    return MAX_VALUE;
  }
  return date.toInterval().getStartMillis();
}

代码示例来源:origin: org.incode.module.base/incode-module-base-dom

/**
 * Does this date contain the specified time interval.
 * 
 * @param date
 * @return
 */
public boolean contains(final LocalDate date) {
  if (date == null){
    return false;
  }
  if (endDate() == null) {
    if (startDate() == null) {
      return true;
    }
    if (date.isEqual(startDate()) || date.isAfter(startDate())) {
      return true;
    }
    return false;
  }
  return asInterval().contains(date.toInterval());
}

相关文章