/** * Outputs this date-time as a {@code String}, such as {@code 2007-12-03T10:15:30+01:00}. * <p> * The output will be one of the following ISO-8601 formats: * <p><ul> * <li>{@code yyyy-MM-dd'T'HH:mmXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ssXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSXXXXX}</li> * </ul><p> * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * * @return a string representation of this date-time, not null */ @Override public String toString() { return dateTime.toString() + offset.toString(); }
/** * Outputs this date-time as a {@code String}, such as {@code 2007-12-23T10:15:30+01:00}. * <p> * The output will be one of the following ISO-8601 formats: * <p><ul> * <li>{@code yyyy-MM-dd'T'HH:mmXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ssXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXXXX}</li> * <li>{@code yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSXXXXX}</li> * </ul><p> * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * * @return a string representation of this date-time, not null */ @Override public String toString() { return dateTime.toString() + offset.toString(); }
/** * Outputs this time as a {@code String}, such as {@code 10:15:30+01:00}. * <p> * The output will be one of the following ISO-8601 formats: * <p><ul> * <li>{@code HH:mmXXXXX}</li> * <li>{@code HH:mm:ssXXXXX}</li> * <li>{@code HH:mm:ss.SSSXXXXX}</li> * <li>{@code HH:mm:ss.SSSSSSXXXXX}</li> * <li>{@code HH:mm:ss.SSSSSSSSSXXXXX}</li> * </ul><p> * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * * @return a string representation of this time, not null */ @Override public String toString() { return time.toString() + offset.toString(); }
/** * Outputs this time as a {@code String}, such as {@code 10:15:30+01:00}. * <p> * The output will be one of the following ISO-8601 formats: * <p><ul> * <li>{@code HH:mmXXXXX}</li> * <li>{@code HH:mm:ssXXXXX}</li> * <li>{@code HH:mm:ss.SSSXXXXX}</li> * <li>{@code HH:mm:ss.SSSSSSXXXXX}</li> * <li>{@code HH:mm:ss.SSSSSSSSSXXXXX}</li> * </ul><p> * The format used will be the shortest that outputs the full value of * the time where the omitted parts are implied to be zero. * * @return a string representation of this time, not null */ @Override public String toString() { return time.toString() + offset.toString(); }
/** * Outputs this date-time as a {@code String}, such as * {@code 2007-12-23T10:15:30+01:00[Europe/Paris]}. * <p> * The format consists of the {@code LocalDateTime} followed by the {@code ZoneOffset}. * If the {@code ZoneId} is not the same as the offset, then the ID is output. * The output is compatible with ISO-8601 if the offset and ID are the same. * * @return a string representation of this date-time, not null */ @Override // override for Javadoc public String toString() { String str = dateTime.toString() + offset.toString(); if (offset != zone) { str += '[' + zone.toString() + ']'; } return str; }
/** * Outputs this date-time as a {@code String}, such as * {@code 2007-12-03T10:15:30+01:00[Europe/Paris]}. * <p> * The format consists of the {@code LocalDateTime} followed by the {@code ZoneOffset}. * If the {@code ZoneId} is not the same as the offset, then the ID is output. * The output is compatible with ISO-8601 if the offset and ID are the same. * * @return a string representation of this date-time, not null */ @Override // override for Javadoc public String toString() { String str = dateTime.toString() + offset.toString(); if (offset != zone) { str += '[' + zone.toString() + ']'; } return str; }
@Override public void serialize(OffsetTime time, JsonGenerator gen, SerializerProvider provider) throws IOException { if (useTimestamp(provider)) { gen.writeStartArray(); gen.writeNumber(time.getHour()); gen.writeNumber(time.getMinute()); final int secs = time.getSecond(); final int nanos = time.getNano(); if (secs > 0 || nanos > 0) { gen.writeNumber(secs); if (nanos > 0) { if(provider.isEnabled(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)) gen.writeNumber(nanos); else gen.writeNumber(time.get(ChronoField.MILLI_OF_SECOND)); } } gen.writeString(time.getOffset().toString()); gen.writeEndArray(); } else { String str = (_formatter == null) ? time.toString() : time.format(_formatter); gen.writeString(str); } } }
@Override public String toString() { String str = toLocalDateTime().toString() + getOffset().toString(); if (getOffset() != getZone()) { str += '[' + getZone().toString() + ']'; } return str; }
@Override public String toString() { String str = toLocalDateTime().toString() + getOffset().toString(); if (getOffset() != getZone()) { str += '[' + getZone().toString() + ']'; } return str; }
/** * Outputs this date-time as a {@code String}. * <p> * The output will include the full zoned date-time and the chronology ID. * * @return a string representation of this date-time, not null */ @Override public String toString() { String str = toLocalDateTime().toString() + getOffset().toString(); if (getOffset() != getZone()) { str += '[' + getZone().toString() + ']'; } return str; }
/** * Outputs this date-time as a {@code String}. * <p> * The output will include the full zoned date-time and the chronology ID. * * @return a string representation of this date-time, not null */ @Override public String toString() { String str = toLocalDateTime().toString() + getOffset().toString(); if (getOffset() != getZone()) { str += '[' + getZone().toString() + ']'; } return str; }