/** * Get the {@link ZonedDateTime} with timezone 'UTC' for the specified field. * The field must have {@link Schema.LogicalType#TIMESTAMP_MILLIS} or {@link Schema.LogicalType#TIMESTAMP_MICROS} * as its logical type. * * @param fieldName zoned date time field to get. * @return value of the field as a {@link ZonedDateTime} * @throws UnexpectedFormatException if the provided field is not of {@link LogicalType#TIMESTAMP_MILLIS} or * {@link LogicalType#TIMESTAMP_MICROS} type. */ @Nullable public ZonedDateTime getTimestamp(String fieldName) { return getTimestamp(fieldName, ZoneId.ofOffset("UTC", ZoneOffset.UTC)); }
/** * Get the {@link ZonedDateTime} with timezone 'UTC' for the specified field. * The field must have {@link Schema.LogicalType#TIMESTAMP_MILLIS} or {@link Schema.LogicalType#TIMESTAMP_MICROS} * as its logical type. * * @param fieldName zoned date time field to get. * @return value of the field as a {@link ZonedDateTime} * @throws UnexpectedFormatException if the provided field is not of {@link LogicalType#TIMESTAMP_MILLIS} or * {@link LogicalType#TIMESTAMP_MICROS} type. */ @Nullable public ZonedDateTime getTimestamp(String fieldName) { return getTimestamp(fieldName, ZoneId.ofOffset("UTC", ZoneOffset.UTC)); }