public class ZonedTimestamp extends Object
STRING representation of
the time and date in a particular time zone, and for defining a Kafka Connect Schema for zoned timestamp values.
The ISO date-time format includes the date, time (including fractional parts), and offset from UTC, such as '2011-12-03T10:15:30+01:00'.
Timestamp,
MicroTimestamp,
NanoTimestamp,
ZonedTime| Modifier and Type | Field and Description |
|---|---|
static DateTimeFormatter |
FORMATTER
The ISO date-time format includes the date, time (including fractional parts), and offset from UTC, such as
'2011-12-03T10:15:30.030431+01:00'.
|
static String |
SCHEMA_NAME |
| Modifier | Constructor and Description |
|---|---|
private |
ZonedTimestamp() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.kafka.connect.data.SchemaBuilder |
builder()
Returns a
SchemaBuilder for a ZonedTimestamp. |
static org.apache.kafka.connect.data.Schema |
schema()
Returns a Schema for a
ZonedTimestamp but with all other default Schema settings. |
static String |
toIsoString(Date timestamp,
ZoneId zoneId,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
Date or one of its JDBC subclasses, using
the supplied timezone information. |
static String |
toIsoString(Date date,
ZoneId zoneId,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
Date, which contains a date but no time or
timezone information. |
static String |
toIsoString(Object value,
ZoneId defaultZone,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
LocalDateTime, LocalDate,
LocalTime, Date, Date, Time,
Timestamp, OffsetTime, or OffsetDateTime, ignoring any date portions of the supplied
value. |
static String |
toIsoString(OffsetDateTime timestamp,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
OffsetDateTime. |
static String |
toIsoString(OffsetTime timestamp,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
OffsetTime. |
static String |
toIsoString(Timestamp timestamp,
ZoneId zoneId,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
Timestamp, which contains a date and time but
has no timezone information. |
static String |
toIsoString(Time time,
ZoneId zoneId,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
Time, which contains time but no date or timezone
information. |
static String |
toIsoString(ZonedDateTime timestamp,
TemporalAdjuster adjuster)
Get the ISO 8601 formatted representation of the given
ZonedDateTime. |
public static final DateTimeFormatter FORMATTER
public static final String SCHEMA_NAME
public static org.apache.kafka.connect.data.SchemaBuilder builder()
SchemaBuilder for a ZonedTimestamp. You can use the resulting SchemaBuilder
to set additional schema settings such as required/optional, default value, and documentation.public static org.apache.kafka.connect.data.Schema schema()
ZonedTimestamp but with all other default Schema settings.builder()public static String toIsoString(Object value, ZoneId defaultZone, TemporalAdjuster adjuster)
LocalDateTime, LocalDate,
LocalTime, Date, Date, Time,
Timestamp, OffsetTime, or OffsetDateTime, ignoring any date portions of the supplied
value.value - the local or SQL date, time, or timestamp value; may not be nulldefaultZone - the time zone that should be used by default if the value does not have timezone information; may not be
nulladjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessaryIllegalArgumentException - if the value is not an instance of the acceptable typespublic static String toIsoString(OffsetDateTime timestamp, TemporalAdjuster adjuster)
OffsetDateTime.timestamp - the timestamp valueadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessarypublic static String toIsoString(ZonedDateTime timestamp, TemporalAdjuster adjuster)
ZonedDateTime.timestamp - the timestamp valueadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessarypublic static String toIsoString(OffsetTime timestamp, TemporalAdjuster adjuster)
OffsetTime.timestamp - the timestamp valueadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessarypublic static String toIsoString(Date timestamp, ZoneId zoneId, TemporalAdjuster adjuster)
Date or one of its JDBC subclasses, using
the supplied timezone information.timestamp - the timestamp valuezoneId - the timezone identifier or offset where the timestamp is definedadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessarypublic static String toIsoString(Timestamp timestamp, ZoneId zoneId, TemporalAdjuster adjuster)
Timestamp, which contains a date and time but
has no timezone information.timestamp - the JDBC timestamp valuezoneId - the timezone identifier or offset where the timestamp is definedadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessarypublic static String toIsoString(Date date, ZoneId zoneId, TemporalAdjuster adjuster)
Date, which contains a date but no time or
timezone information.date - the date valuezoneId - the timezone identifier or offset where the date is definedadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessarypublic static String toIsoString(Time time, ZoneId zoneId, TemporalAdjuster adjuster)
Time, which contains time but no date or timezone
information.time - the JDBC time valuezoneId - the timezone identifier or offset where the time is definedadjuster - the optional component that adjusts the local date value before obtaining the epoch day; may be null if no
adjustment is necessaryCopyright © 2021 JBoss by Red Hat. All rights reserved.