@Override public Instant apply(FromDecimalArguments a) { return Instant.ofEpochSecond(a.integer, a.fraction); } },
@Override public Instant apply(FromDecimalArguments a) { return Instant.ofEpochSecond(a.integer, a.fraction); } },
@Override public Instant apply(FromDecimalArguments a) { return Instant.ofEpochSecond(a.integer, a.fraction); } },
/** * Converts a {@code java.sql.Timestamp} to an {@code Instant}. * * @param sqlTimestamp the SQL timestamp, not null * @return the instant, not null */ public static Instant toInstant(Timestamp sqlTimestamp) { return Instant.ofEpochSecond(sqlTimestamp.getTime() / 1000, sqlTimestamp.getNanos()); }
static Instant readExternal(DataInput in) throws IOException { long seconds = in.readLong(); int nanos = in.readInt(); return Instant.ofEpochSecond(seconds, nanos); }
/** * Converts a {@code java.sql.Timestamp} to an {@code Instant}. * * @param sqlTimestamp the SQL timestamp, not null * @return the instant, not null */ public static Instant toInstant(Timestamp sqlTimestamp) { return Instant.ofEpochSecond(sqlTimestamp.getTime() / 1000, sqlTimestamp.getNanos()); }
static Instant readExternal(DataInput in) throws IOException { long seconds = in.readLong(); int nanos = in.readInt(); return Instant.ofEpochSecond(seconds, nanos); }
@Override public ZonedDateTime apply(FromDecimalArguments a) { return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public OffsetDateTime apply(FromDecimalArguments a) { return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public OffsetDateTime apply(FromDecimalArguments a) { return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public OffsetDateTime apply(FromDecimalArguments a) { return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public ZonedDateTime apply(FromDecimalArguments a) { return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public ZonedDateTime apply(FromDecimalArguments a) { return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public ZonedDateTime apply(FromDecimalArguments a) { return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
@Override public OffsetDateTime apply(FromDecimalArguments a) { return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); } },
/** * Converts this date-time to an {@code Instant}. * <p> * This combines this local date-time and the specified offset to form * an {@code Instant}. * * @param offset the offset to use for the conversion, not null * @return an {@code Instant} representing the same instant, not null */ public Instant toInstant(ZoneOffset offset) { return Instant.ofEpochSecond(toEpochSecond(offset), toLocalTime().getNano()); }
/** * Converts this date-time to an {@code Instant}. * <p> * This combines this local date-time and the specified offset to form * an {@code Instant}. * * @param offset the offset to use for the conversion, not null * @return an {@code Instant} representing the same instant, not null */ public Instant toInstant(ZoneOffset offset) { return Instant.ofEpochSecond(toEpochSecond(offset), toLocalTime().getNano()); }
/** * Converts this date-time to an {@code Instant}. * <p> * This returns an {@code Instant} representing the same point on the * time-line as this date-time. The calculation combines the * {@linkplain #toLocalDateTime() local date-time} and * {@linkplain #getOffset() offset}. * * @return an {@code Instant} representing the same instant, not null */ public Instant toInstant() { return Instant.ofEpochSecond(toEpochSecond(), toLocalTime().getNano()); }
private void mergeInstantFields0(ZoneId selectedZone) { Instant instant = Instant.ofEpochSecond(fieldValues.remove(INSTANT_SECONDS)); ChronoZonedDateTime<?> zdt = chrono.zonedDateTime(instant, selectedZone); if (date == null) { addObject(zdt.toLocalDate()); } else { resolveMakeChanges(INSTANT_SECONDS, zdt.toLocalDate()); } addFieldValue(SECOND_OF_DAY, (long) zdt.toLocalTime().toSecondOfDay()); }
private void mergeInstantFields0(ZoneId selectedZone) { Instant instant = Instant.ofEpochSecond(fieldValues.remove(INSTANT_SECONDS)); ChronoZonedDateTime<?> zdt = chrono.zonedDateTime(instant, selectedZone); if (date == null) { addObject(zdt.toLocalDate()); } else { resolveMakeChanges(INSTANT_SECONDS, zdt.toLocalDate()); } addFieldValue(SECOND_OF_DAY, (long) zdt.toLocalTime().toSecondOfDay()); }