org.joda.time.LocalTime.<init>()方法的使用及代码示例

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

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

LocalTime.<init>介绍

[英]Constructs an instance set to the current local time evaluated using ISO chronology in the default zone.

Once the constructor is completed, the zone is no longer used.
[中]构造一个实例集,该实例集使用默认分区中的ISO年表计算当前本地时间。
一旦构造完成,区域将不再使用。

代码示例

代码示例来源:origin: apache/flink

@Override
  public LocalTime copy(Kryo kryo, LocalTime original) {
    return new LocalTime(original);
  }
}

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

/**
 * Obtains a {@code LocalTime} set to the current system millisecond time
 * using <code>ISOChronology</code> in the default time zone.
 * The resulting object does not use the zone.
 * 
 * @return the current time, not null
 * @since 2.0
 */
public static LocalTime now() {
  return new LocalTime();
}

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

/**
 * Obtains a {@code LocalTime} set to the current system millisecond time
 * using <code>ISOChronology</code> in the default time zone.
 * The resulting object does not use the zone.
 * 
 * @return the current time, not null
 * @since 2.0
 */
public static LocalTime now() {
  return new LocalTime();
}

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

/**
 * Obtains a {@code LocalTime} set to the current system millisecond time
 * using <code>ISOChronology</code> in the specified time zone.
 * The resulting object does not use the zone.
 *
 * @param zone  the time zone, not null
 * @return the current time, not null
 * @since 2.0
 */
public static LocalTime now(DateTimeZone zone) {
  if (zone == null) {
    throw new NullPointerException("Zone must not be null");
  }
  return new LocalTime(zone);
}

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

/**
 * Obtains a {@code LocalTime} set to the current system millisecond time
 * using the specified chronology.
 * The resulting object does not use the zone.
 *
 * @param chronology  the chronology, not null
 * @return the current time, not null
 * @since 2.0
 */
public static LocalTime now(Chronology chronology) {
  if (chronology == null) {
    throw new NullPointerException("Chronology must not be null");
  }
  return new LocalTime(chronology);
}

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

/**
 * Obtains a {@code LocalTime} set to the current system millisecond time
 * using <code>ISOChronology</code> in the specified time zone.
 * The resulting object does not use the zone.
 *
 * @param zone  the time zone, not null
 * @return the current time, not null
 * @since 2.0
 */
public static LocalTime now(DateTimeZone zone) {
  if (zone == null) {
    throw new NullPointerException("Zone must not be null");
  }
  return new LocalTime(zone);
}

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

/**
 * Obtains a {@code LocalTime} set to the current system millisecond time
 * using the specified chronology.
 * The resulting object does not use the zone.
 *
 * @param chronology  the chronology, not null
 * @return the current time, not null
 * @since 2.0
 */
public static LocalTime now(Chronology chronology) {
  if (chronology == null) {
    throw new NullPointerException("Chronology must not be null");
  }
  return new LocalTime(chronology);
}

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

/**
 * Converts this object to a <code>LocalTime</code> with the
 * same time and chronology.
 *
 * @return a LocalTime with the same time and chronology
 * @since 1.3
 */
public LocalTime toLocalTime() {
  return new LocalTime(getMillis(), getChronology());
}

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

/**
 * Converts this object to a <code>LocalTime</code> with the
 * same time and chronology.
 *
 * @return a LocalTime with the same time and chronology
 * @since 1.3
 */
public LocalTime toLocalTime() {
  return new LocalTime(getMillis(), getChronology());
}

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

/**
 * Converts this object to a LocalTime with the same time and chronology.
 *
 * @return a LocalTime with the same time and chronology
 */
public LocalTime toLocalTime() {
  return new LocalTime(getLocalMillis(), getChronology());
}

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

/**
 * Returns a copy of this time with different local millis.
 * <p>
 * The returned object will be a new instance of the same type.
 * Only the millis will change, the chronology is kept.
 * The returned object will be either be a new instance or <code>this</code>.
 *
 * @param newMillis  the new millis, from 1970-01-01T00:00:00
 * @return a copy of this time with different millis
 */
LocalTime withLocalMillis(long newMillis) {
  return (newMillis == getLocalMillis() ? this : new LocalTime(newMillis, getChronology()));
}

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

/**
 * Handle broken serialization from other tools.
 * @return the resolved object, not null
 */
private Object readResolve() {
  if (iChronology == null) {
    return new LocalTime(iLocalMillis, ISOChronology.getInstanceUTC());
  }
  if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) {
    return new LocalTime(iLocalMillis, iChronology.withUTC());
  }
  return this;
}

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

/**
 * Converts this object to a LocalTime with the same time and chronology.
 *
 * @return a LocalTime with the same time and chronology
 */
public LocalTime toLocalTime() {
  return new LocalTime(getLocalMillis(), getChronology());
}

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

/**
 * Returns a copy of this time with different local millis.
 * <p>
 * The returned object will be a new instance of the same type.
 * Only the millis will change, the chronology is kept.
 * The returned object will be either be a new instance or <code>this</code>.
 *
 * @param newMillis  the new millis, from 1970-01-01T00:00:00
 * @return a copy of this time with different millis
 */
LocalTime withLocalMillis(long newMillis) {
  return (newMillis == getLocalMillis() ? this : new LocalTime(newMillis, getChronology()));
}

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

/**
 * Handle broken serialization from other tools.
 * @return the resolved object, not null
 */
private Object readResolve() {
  if (iChronology == null) {
    return new LocalTime(iLocalMillis, ISOChronology.getInstanceUTC());
  }
  if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) {
    return new LocalTime(iLocalMillis, iChronology.withUTC());
  }
  return this;
}

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

/**
 * Constructs a LocalTime from the specified millis of day using the
 * specified chronology.
 * <p>
 * The millisOfDay value may exceed the number of millis in one day,
 * but additional days will be ignored.
 * This method uses the UTC time zone internally.
 *
 * @param millisOfDay  the number of milliseconds into a day to convert
 * @param chrono  the chronology, null means ISO chronology
 */
public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) {
  chrono = DateTimeUtils.getChronology(chrono).withUTC();
  return new LocalTime(millisOfDay, chrono);
}

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

/**
 * Constructs a LocalTime from the specified millis of day using the
 * specified chronology.
 * <p>
 * The millisOfDay value may exceed the number of millis in one day,
 * but additional days will be ignored.
 * This method uses the UTC time zone internally.
 *
 * @param millisOfDay  the number of milliseconds into a day to convert
 * @param chrono  the chronology, null means ISO chronology
 */
public static LocalTime fromMillisOfDay(long millisOfDay, Chronology chrono) {
  chrono = DateTimeUtils.getChronology(chrono).withUTC();
  return new LocalTime(millisOfDay, chrono);
}

代码示例来源:origin: apache/flink

@Override
public LocalTime read(Kryo kryo, Input input, Class<LocalTime> type) {
  final int time = input.readInt(true);
  return new LocalTime(time, ISOChronology.getInstanceUTC().withZone(DateTimeZone.UTC));
}

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

/**
 * Converts this object to a LocalTime with the same time and chronology.
 *
 * @return a LocalTime with the same time and chronology
 * @since 1.3
 */
public LocalTime toLocalTime() {
  return new LocalTime(getHourOfDay(), getMinuteOfHour(),
      getSecondOfMinute(), getMillisOfSecond(), getChronology());
}

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

/**
 * Converts this object to a LocalTime with the same time and chronology.
 *
 * @return a LocalTime with the same time and chronology
 * @since 1.3
 */
public LocalTime toLocalTime() {
  return new LocalTime(getHourOfDay(), getMinuteOfHour(),
      getSecondOfMinute(), getMillisOfSecond(), getChronology());
}

相关文章