diff --git a/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/AvroToRowConverter.java b/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/AvroToRowConverter.java index 898793c2413a..d35669cfeac1 100644 --- a/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/AvroToRowConverter.java +++ b/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/AvroToRowConverter.java @@ -120,7 +120,8 @@ private Object convertField(SeaTunnelDataType dataType, Schema.Field field, O return LocalDate.ofEpochDay((Long) val); case TIMESTAMP: return LocalDateTime.ofInstant( - Instant.ofEpochMilli((Long) val), ZoneOffset.of("+8")); + Instant.ofEpochMilli((Long) val), + ZoneOffset.of(ZoneOffset.systemDefault().getId())); case ROW: SeaTunnelRowType subRow = (SeaTunnelRowType) dataType; return converter((GenericRecord) val, subRow); diff --git a/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/RowToAvroConverter.java b/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/RowToAvroConverter.java index c237afdd8601..26759e662bc4 100644 --- a/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/RowToAvroConverter.java +++ b/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/RowToAvroConverter.java @@ -221,7 +221,9 @@ private Object resolveObject(Object data, SeaTunnelDataType seaTunnelDataType return recordBuilder.build(); case TIMESTAMP: LocalDateTime dateTime = (LocalDateTime) data; - return (dateTime).toInstant(ZoneOffset.of("+8")).toEpochMilli(); + return (dateTime) + .toInstant(ZoneOffset.of(ZoneOffset.systemDefault().getId())) + .toEpochMilli(); default: String errorMsg = String.format(