/** * Gets the second-of-minute field. * * @return the second-of-minute, from 0 to 59 */ public int getSecond() { return dateTime.getSecond(); }
/** * Gets the second-of-minute field. * * @return the second-of-minute, from 0 to 59 */ public int getSecond() { return dateTime.getSecond(); }
/** * Gets the second-of-minute field. * * @return the second-of-minute, from 0 to 59 */ public int getSecond() { return dateTime.getSecond(); }
/** * Gets the second-of-minute field. * * @return the second-of-minute, from 0 to 59 */ public int getSecond() { return dateTime.getSecond(); }
@Override public void serialize(LocalDateTime value, JsonGenerator g, SerializerProvider provider) throws IOException { if (useTimestamp(provider)) { g.writeStartArray(); g.writeNumber(value.getYear()); g.writeNumber(value.getMonthValue()); g.writeNumber(value.getDayOfMonth()); g.writeNumber(value.getHour()); g.writeNumber(value.getMinute()); if (value.getSecond() > 0 || value.getNano() > 0) { g.writeNumber(value.getSecond()); if(value.getNano() > 0) { if (provider.isEnabled(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)) g.writeNumber(value.getNano()); else g.writeNumber(value.get(ChronoField.MILLI_OF_SECOND)); } } g.writeEndArray(); } else { DateTimeFormatter dtf = _formatter; if (dtf == null) { dtf = _defaultFormatter(); } g.writeString(value.format(dtf)); } }
/** * Converts a {@code LocalDateTime} to a {@code java.sql.Timestamp}. * * @param dateTime the local date-time, not null * @return the SQL timestamp, not null */ @SuppressWarnings("deprecation") public static Timestamp toSqlTimestamp(LocalDateTime dateTime) { return new Timestamp( dateTime.getYear() - 1900, dateTime.getMonthValue() - 1, dateTime.getDayOfMonth(), dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond(), dateTime.getNano()); }
/** * Converts a {@code LocalDateTime} to a {@code java.sql.Timestamp}. * * @param dateTime the local date-time, not null * @return the SQL timestamp, not null */ @SuppressWarnings("deprecation") public static Timestamp toSqlTimestamp(LocalDateTime dateTime) { return new Timestamp( dateTime.getYear() - 1900, dateTime.getMonthValue() - 1, dateTime.getDayOfMonth(), dateTime.getHour(), dateTime.getMinute(), dateTime.getSecond(), dateTime.getNano()); }
NumberConverter.write2(value.getMinute(), buf, pos + 15); buf[pos + 17] = ':'; NumberConverter.write2(value.getSecond(), buf, pos + 18); final int nano = value.getNano(); if (nano != 0) {