/** * Gets the {@code LocalTime} part of this date-time. * <p> * This returns a {@code LocalTime} with the same hour, minute, second and * nanosecond as this date-time. * * @return the time part of this date-time, not null */ @Override // override for Javadoc and performance public LocalTime toLocalTime() { return dateTime.toLocalTime(); }
/** * Gets the {@code LocalTime} part of this date-time. * <p> * This returns a {@code LocalTime} with the same hour, minute, second and * nanosecond as this date-time. * * @return the time part of this date-time, not null */ @Override // override for Javadoc and performance public LocalTime toLocalTime() { return dateTime.toLocalTime(); }
/** * Gets the {@code LocalTime} part of this date-time. * <p> * This returns a {@code LocalTime} with the same hour, minute, second and * nanosecond as this date-time. * * @return the time part of this date-time, not null */ public LocalTime toLocalTime() { return dateTime.toLocalTime(); }
/** * Gets the {@code LocalTime} part of this date-time. * <p> * This returns a {@code LocalTime} with the same hour, minute, second and * nanosecond as this date-time. * * @return the time part of this date-time, not null */ public LocalTime toLocalTime() { return dateTime.toLocalTime(); }
/** * Converts this date-time to an {@code OffsetTime}. * <p> * This returns an offset time with the same local time and offset. * * @return an OffsetTime representing the time and offset, not null */ public OffsetTime toOffsetTime() { return OffsetTime.of(dateTime.toLocalTime(), offset); }
/** * Converts this date-time to an {@code OffsetTime}. * <p> * This returns an offset time with the same local time and offset. * * @return an OffsetTime representing the time and offset, not null */ public OffsetTime toOffsetTime() { return OffsetTime.of(dateTime.toLocalTime(), offset); }
@Nonnull @Override public LocalTime convert(Date source) { return ofInstant(ofEpochMilli(source.getTime()), systemDefault()).toLocalTime(); } }
private int compareTo0(LocalDateTime other) { int cmp = date.compareTo0(other.toLocalDate()); if (cmp == 0) { cmp = time.compareTo(other.toLocalTime()); } return cmp; }
private int compareTo0(LocalDateTime other) { int cmp = date.compareTo0(other.toLocalDate()); if (cmp == 0) { cmp = time.compareTo(other.toLocalTime()); } return cmp; }
/** * Adds a single transition rule to the current window. * <p> * This adds a rule such that the offset, expressed as a daylight savings amount, * changes at the specified date-time. * * @param transitionDateTime the date-time that the transition occurs as defined by timeDefintion, not null * @param timeDefinition the definition of how to convert local to actual time, not null * @param savingAmountSecs the amount of saving from the standard offset after the transition in seconds * @return this, for chaining * @throws IllegalStateException if no window has yet been added * @throws IllegalStateException if the window already has fixed savings * @throws IllegalStateException if the window has reached the maximum capacity of 2000 rules */ public ZoneRulesBuilder addRuleToWindow( LocalDateTime transitionDateTime, TimeDefinition timeDefinition, int savingAmountSecs) { Jdk8Methods.requireNonNull(transitionDateTime, "transitionDateTime"); return addRuleToWindow( transitionDateTime.getYear(), transitionDateTime.getYear(), transitionDateTime.getMonth(), transitionDateTime.getDayOfMonth(), null, transitionDateTime.toLocalTime(), false, timeDefinition, savingAmountSecs); }
/** * Adds a single transition rule to the current window. * <p> * This adds a rule such that the offset, expressed as a daylight savings amount, * changes at the specified date-time. * * @param transitionDateTime the date-time that the transition occurs as defined by timeDefintion, not null * @param timeDefinition the definition of how to convert local to actual time, not null * @param savingAmountSecs the amount of saving from the standard offset after the transition in seconds * @return this, for chaining * @throws IllegalStateException if no window has yet been added * @throws IllegalStateException if the window already has fixed savings * @throws IllegalStateException if the window has reached the maximum capacity of 2000 rules */ public ZoneRulesBuilder addRuleToWindow( LocalDateTime transitionDateTime, TimeDefinition timeDefinition, int savingAmountSecs) { Jdk8Methods.requireNonNull(transitionDateTime, "transitionDateTime"); return addRuleToWindow( transitionDateTime.getYear(), transitionDateTime.getYear(), transitionDateTime.getMonth(), transitionDateTime.getDayOfMonth(), null, transitionDateTime.toLocalTime(), false, timeDefinition, savingAmountSecs); }
return resolveLocal(LocalDateTime.of((LocalDate) adjuster, dateTime.toLocalTime())); } else if (adjuster instanceof LocalTime) { return resolveLocal(LocalDateTime.of(dateTime.toLocalDate(), (LocalTime) adjuster));
return resolveLocal(LocalDateTime.of((LocalDate) adjuster, dateTime.toLocalTime())); } else if (adjuster instanceof LocalTime) { return resolveLocal(LocalDateTime.of(dateTime.toLocalDate(), (LocalTime) adjuster));