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

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

本文整理了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

  1. @Override
  2. public LocalTime copy(Kryo kryo, LocalTime original) {
  3. return new LocalTime(original);
  4. }
  5. }

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

  1. /**
  2. * Obtains a {@code LocalTime} set to the current system millisecond time
  3. * using <code>ISOChronology</code> in the default time zone.
  4. * The resulting object does not use the zone.
  5. *
  6. * @return the current time, not null
  7. * @since 2.0
  8. */
  9. public static LocalTime now() {
  10. return new LocalTime();
  11. }

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

  1. /**
  2. * Obtains a {@code LocalTime} set to the current system millisecond time
  3. * using <code>ISOChronology</code> in the default time zone.
  4. * The resulting object does not use the zone.
  5. *
  6. * @return the current time, not null
  7. * @since 2.0
  8. */
  9. public static LocalTime now() {
  10. return new LocalTime();
  11. }

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

  1. /**
  2. * Obtains a {@code LocalTime} set to the current system millisecond time
  3. * using <code>ISOChronology</code> in the specified time zone.
  4. * The resulting object does not use the zone.
  5. *
  6. * @param zone the time zone, not null
  7. * @return the current time, not null
  8. * @since 2.0
  9. */
  10. public static LocalTime now(DateTimeZone zone) {
  11. if (zone == null) {
  12. throw new NullPointerException("Zone must not be null");
  13. }
  14. return new LocalTime(zone);
  15. }

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

  1. /**
  2. * Obtains a {@code LocalTime} set to the current system millisecond time
  3. * using the specified chronology.
  4. * The resulting object does not use the zone.
  5. *
  6. * @param chronology the chronology, not null
  7. * @return the current time, not null
  8. * @since 2.0
  9. */
  10. public static LocalTime now(Chronology chronology) {
  11. if (chronology == null) {
  12. throw new NullPointerException("Chronology must not be null");
  13. }
  14. return new LocalTime(chronology);
  15. }

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

  1. /**
  2. * Obtains a {@code LocalTime} set to the current system millisecond time
  3. * using <code>ISOChronology</code> in the specified time zone.
  4. * The resulting object does not use the zone.
  5. *
  6. * @param zone the time zone, not null
  7. * @return the current time, not null
  8. * @since 2.0
  9. */
  10. public static LocalTime now(DateTimeZone zone) {
  11. if (zone == null) {
  12. throw new NullPointerException("Zone must not be null");
  13. }
  14. return new LocalTime(zone);
  15. }

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

  1. /**
  2. * Obtains a {@code LocalTime} set to the current system millisecond time
  3. * using the specified chronology.
  4. * The resulting object does not use the zone.
  5. *
  6. * @param chronology the chronology, not null
  7. * @return the current time, not null
  8. * @since 2.0
  9. */
  10. public static LocalTime now(Chronology chronology) {
  11. if (chronology == null) {
  12. throw new NullPointerException("Chronology must not be null");
  13. }
  14. return new LocalTime(chronology);
  15. }

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

  1. /**
  2. * Converts this object to a <code>LocalTime</code> with the
  3. * same time and chronology.
  4. *
  5. * @return a LocalTime with the same time and chronology
  6. * @since 1.3
  7. */
  8. public LocalTime toLocalTime() {
  9. return new LocalTime(getMillis(), getChronology());
  10. }

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

  1. /**
  2. * Converts this object to a <code>LocalTime</code> with the
  3. * same time and chronology.
  4. *
  5. * @return a LocalTime with the same time and chronology
  6. * @since 1.3
  7. */
  8. public LocalTime toLocalTime() {
  9. return new LocalTime(getMillis(), getChronology());
  10. }

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

  1. /**
  2. * Converts this object to a LocalTime with the same time and chronology.
  3. *
  4. * @return a LocalTime with the same time and chronology
  5. */
  6. public LocalTime toLocalTime() {
  7. return new LocalTime(getLocalMillis(), getChronology());
  8. }

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

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

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

  1. /**
  2. * Handle broken serialization from other tools.
  3. * @return the resolved object, not null
  4. */
  5. private Object readResolve() {
  6. if (iChronology == null) {
  7. return new LocalTime(iLocalMillis, ISOChronology.getInstanceUTC());
  8. }
  9. if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) {
  10. return new LocalTime(iLocalMillis, iChronology.withUTC());
  11. }
  12. return this;
  13. }

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

  1. /**
  2. * Converts this object to a LocalTime with the same time and chronology.
  3. *
  4. * @return a LocalTime with the same time and chronology
  5. */
  6. public LocalTime toLocalTime() {
  7. return new LocalTime(getLocalMillis(), getChronology());
  8. }

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

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

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

  1. /**
  2. * Handle broken serialization from other tools.
  3. * @return the resolved object, not null
  4. */
  5. private Object readResolve() {
  6. if (iChronology == null) {
  7. return new LocalTime(iLocalMillis, ISOChronology.getInstanceUTC());
  8. }
  9. if (DateTimeZone.UTC.equals(iChronology.getZone()) == false) {
  10. return new LocalTime(iLocalMillis, iChronology.withUTC());
  11. }
  12. return this;
  13. }

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

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

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

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

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

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

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

  1. /**
  2. * Converts this object to a LocalTime with the same time and chronology.
  3. *
  4. * @return a LocalTime with the same time and chronology
  5. * @since 1.3
  6. */
  7. public LocalTime toLocalTime() {
  8. return new LocalTime(getHourOfDay(), getMinuteOfHour(),
  9. getSecondOfMinute(), getMillisOfSecond(), getChronology());
  10. }

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

  1. /**
  2. * Converts this object to a LocalTime with the same time and chronology.
  3. *
  4. * @return a LocalTime with the same time and chronology
  5. * @since 1.3
  6. */
  7. public LocalTime toLocalTime() {
  8. return new LocalTime(getHourOfDay(), getMinuteOfHour(),
  9. getSecondOfMinute(), getMillisOfSecond(), getChronology());
  10. }

相关文章