Skip to content

Commit

Permalink
[feature] use system timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
liunaijie committed Aug 29, 2023
1 parent fa5b96c commit 8ddc8ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8ddc8ff

Please sign in to comment.