private StringConverter createLocalTimeZoneTimestampConverter() {
        return new StringConverter() {

            private static final long serialVersionUID = 1L;

            @Override
            public String convert(Object dbzObj, Schema schema) throws Exception {
                return SQL_TIMESTAMP_WITH_LOCAL_TIMEZONE_FORMAT.format(
                        toTimestampData(dbzObj, schema).toInstant().atOffset(ZoneOffset.UTC));
            }

            private TimestampData toTimestampData(Object dbzObj, Schema schema) throws Exception {
                if (dbzObj instanceof String) {
                    String str = (String) dbzObj;
                    // TIMESTAMP type is encoded in string type
                    Instant instant = Instant.parse(str);
                    return TimestampData.fromLocalDateTime(
                            LocalDateTime.ofInstant(instant, serverTimeZone));
                }
                throw new IllegalArgumentException(
                        "Unable to convert to TimestampData from unexpected value '"
                                + dbzObj
                                + "' of type "
                                + dbzObj.getClass().getName());
            }
        };
    }
Formatter for SQL string representation of a timestamp value (with UTC timezone).
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/mysql-cdc/src/main/java/org/apache/inlong/sort/cdc/mysql/table/OldFieldMetadataConverter.java