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

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

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

LocalDate.toDateTimeAtMidnight介绍

[英]Converts this LocalDate to a full datetime at midnight using the default time zone.

This method will throw an exception if the default time zone switches to Daylight Savings Time at midnight and this LocalDate represents that switchover date. The problem is that there is no such time as midnight on the required date, and as such an exception is thrown.

This instance is immutable and unaffected by this method call.
[中]使用默认时区将此LocalDate转换为午夜的完整日期时间。
如果默认时区在午夜切换为夏令时,并且此LocalDate表示切换日期,则此方法将引发异常。问题是在所需日期没有午夜这样的时间,因此会引发异常。
此实例是不可变的,不受此方法调用的影响。

代码示例

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

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

/**
 * Converts this LocalDate to a full datetime at midnight using the default
 * time zone.
 * <p>
 * This method will throw an exception if the default time zone switches
 * to Daylight Savings Time at midnight and this LocalDate represents
 * that switchover date. The problem is that there is no such time as
 * midnight on the required date, and as such an exception is thrown.
 * <p>
 * This instance is immutable and unaffected by this method call.
 * 
 * @return this date as a datetime at midnight
 * @deprecated Use {@link #toDateTimeAtStartOfDay()} which won't throw an exception
 */
@Deprecated
public DateTime toDateTimeAtMidnight() {
  return toDateTimeAtMidnight(null);
}

代码示例来源:origin: net.sf.doolin/doolin-gui

/**
 * Extracts the date from the item.
 * 
 * @param item
 *            Item
 * @return Date
 */
protected Date getDate(Object item) {
  if (item == null) {
    return null;
  } else if (item instanceof Date) {
    return (Date) item;
  } else if (item instanceof Calendar) {
    return ((Calendar) item).getTime();
  } else if (item instanceof DateTime) {
    DateTime dateTime = (DateTime) item;
    return dateTime.toDate();
  } else if (item instanceof LocalDateTime) {
    LocalDateTime dateTime = (LocalDateTime) item;
    return dateTime.toDateTime().toDate();
  } else if (item instanceof LocalDate) {
    LocalDate dateTime = (LocalDate) item;
    return dateTime.toDateTimeAtMidnight().toDate();
  } else {
    throw new LocalizableException("DateLabelnfoProvider.CannotGetDate", item
        .getClass().getName());
  }
}

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

public EventPaymentCode(Person creator, LocalDate startDate, LocalDate endDate, Money minAmount, Money
    maxAmount) {
  init(PaymentCodeType.EVENT, startDate.toDateMidnight().toYearMonthDay(), endDate.toDateTimeAtMidnight().toYearMonthDay(), minAmount,
      maxAmount, creator);
}

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

private String getRegistrationFee(final PhdIndividualProgramProcess individualProgramProcess, final LocalDate whenRatified) {
  return whenRatified != null ? ((FixedAmountPR) individualProgramProcess.getPhdProgram().getServiceAgreementTemplate()
      .findPostingRuleByEventTypeAndDate(EventType.PHD_REGISTRATION_FEE, whenRatified.toDateTimeAtMidnight()))
      .getFixedAmount().toPlainString() : "";
}

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

PhdGratuityEvent.create(getProcess(request), year, process.getWhenFormalizedRegistration().toDateTimeAtMidnight());

相关文章