/** * Gets the day-of-month field. * <p> * This method returns the primitive {@code int} value for the day-of-month. * * @return the day-of-month, from 1 to 31 */ public int getDayOfMonth() { return dateTime.getDayOfMonth(); }
/** * Gets the day-of-month field. * <p> * This method returns the primitive {@code int} value for the day-of-month. * * @return the day-of-month, from 1 to 31 */ public int getDayOfMonth() { return dateTime.getDayOfMonth(); }
/** * Gets the day-of-month field. * <p> * This method returns the primitive {@code int} value for the day-of-month. * * @return the day-of-month, from 1 to 31 */ public int getDayOfMonth() { return dateTime.getDayOfMonth(); }
/** * Gets the day-of-month field. * <p> * This method returns the primitive {@code int} value for the day-of-month. * * @return the day-of-month, from 1 to 31 */ public int getDayOfMonth() { return dateTime.getDayOfMonth(); }
@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()); }
/** * 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); }
allDaysOfWeek.add(ldt.getDayOfMonth()); }while((ldt = ldt.plus(org.threeten.bp.Period.ofWeeks(1))).getMonth() == month);
NumberConverter.write2(value.getMonthValue(), buf, pos + 6); buf[pos + 8] = '-'; NumberConverter.write2(value.getDayOfMonth(), buf, pos + 9); buf[pos + 11] = 'T'; NumberConverter.write2(value.getHour(), buf, pos + 12);