@Override public Instant queryFrom(TemporalAccessor temporal) { return Instant.from(temporal); } });
@Override public Instant apply(TemporalAccessor temporalAccessor) { return Instant.from(temporalAccessor); } },
@Override public Instant apply(TemporalAccessor temporalAccessor) { return Instant.from(temporalAccessor); } },
@Override public Instant queryFrom(TemporalAccessor temporal) { return Instant.from(temporal); } };
@Override public Instant queryFrom(TemporalAccessor temporal) { return Instant.from(temporal); } };
@Override public Instant apply(TemporalAccessor temporalAccessor) { return Instant.from(temporalAccessor); } },
@Override public Instant apply(TemporalAccessor temporalAccessor) { return Instant.from(temporalAccessor); } },
@Override public ScalarInstant toValue(String value) { return new InstantScalarInstant(Instant.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(value))); } }
@Override public ScalarInstant toValue(String value) { return new InstantScalarInstant(Instant.from(MYSQL_JSON_INSTANT.parse(value))); }
@Override public ScalarInstant fromJsonValue(JsonString value) { return new InstantScalarInstant(Instant.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(value.getString()))); } }
@Override public ScalarInstant fromJsonValue(JsonString value) { return new InstantScalarInstant(Instant.from(InstantValueToJsonConverter.MYSQL_JSON_INSTANT.parse(value.getString()))); } }
return OffsetDateTime.of(ldt, offset); } catch (DateTimeException ignore) { Instant instant = Instant.from(temporal); return OffsetDateTime.ofInstant(instant, offset);
return OffsetDateTime.of(ldt, offset); } catch (DateTimeException ignore) { Instant instant = Instant.from(temporal); return OffsetDateTime.ofInstant(instant, offset);
/** * Obtains a zoned date-time in this chronology from another temporal object. * <p> * This creates a date-time in this chronology based on the specified {@code TemporalAccessor}. * <p> * This should obtain a {@code ZoneId} using {@link ZoneId#from(TemporalAccessor)}. * The date-time should be obtained by obtaining an {@code Instant}. * If that fails, the local date-time should be used. * * @param temporal the temporal object to convert, not null * @return the zoned date-time in this chronology, not null * @throws DateTimeException if unable to create the date-time */ @SuppressWarnings({ "rawtypes", "unchecked" }) public ChronoZonedDateTime<?> zonedDateTime(TemporalAccessor temporal) { try { ZoneId zone = ZoneId.from(temporal); try { Instant instant = Instant.from(temporal); return zonedDateTime(instant, zone); } catch (DateTimeException ex1) { ChronoLocalDateTime cldt = localDateTime(temporal); ChronoLocalDateTimeImpl cldtImpl = ensureChronoLocalDateTime(cldt); return ChronoZonedDateTimeImpl.ofBest(cldtImpl, zone, null); } } catch (DateTimeException ex) { throw new DateTimeException("Unable to obtain ChronoZonedDateTime from TemporalAccessor: " + temporal.getClass(), ex); } }
/** * Obtains a zoned date-time in this chronology from another temporal object. * <p> * This creates a date-time in this chronology based on the specified {@code TemporalAccessor}. * <p> * This should obtain a {@code ZoneId} using {@link ZoneId#from(TemporalAccessor)}. * The date-time should be obtained by obtaining an {@code Instant}. * If that fails, the local date-time should be used. * * @param temporal the temporal object to convert, not null * @return the zoned date-time in this chronology, not null * @throws DateTimeException if unable to create the date-time */ @SuppressWarnings({ "rawtypes", "unchecked" }) public ChronoZonedDateTime<?> zonedDateTime(TemporalAccessor temporal) { try { ZoneId zone = ZoneId.from(temporal); try { Instant instant = Instant.from(temporal); return zonedDateTime(instant, zone); } catch (DateTimeException ex1) { ChronoLocalDateTime cldt = localDateTime(temporal); ChronoLocalDateTimeImpl cldtImpl = ensureChronoLocalDateTime(cldt); return ChronoZonedDateTimeImpl.ofBest(cldtImpl, zone, null); } } catch (DateTimeException ex) { throw new DateTimeException("Unable to obtain ChronoZonedDateTime from TemporalAccessor: " + temporal.getClass(), ex); } }
Instant end = Instant.from(endExclusive); if (unit instanceof ChronoUnit) { ChronoUnit f = (ChronoUnit) unit;
Instant end = Instant.from(endExclusive); if (unit instanceof ChronoUnit) { ChronoUnit f = (ChronoUnit) unit;
return chrono.zonedDateTime(Instant.from(temporal), overrideZone);
return chrono.zonedDateTime(Instant.from(temporal), overrideZone);