@ConstantFunction.List(list = {
            @ConstantFunction(name = "convert_tz", argTypes = {DATE, VARCHAR, VARCHAR}, returnType = DATETIME),
            @ConstantFunction(name = "convert_tz", argTypes = {DATETIME, VARCHAR, VARCHAR}, returnType = DATETIME)
    })
    public static ConstantOperator convert_tz(ConstantOperator arg, ConstantOperator fromTz, ConstantOperator toTz) {
        LocalDateTime dt = arg.getDatetime();
        ZoneId oldZone = ZoneId.of(fromTz.getVarchar());

        ZoneId newZone = ZoneId.of(toTz.getVarchar());
        LocalDateTime newDateTime = dt.atZone(oldZone).withZoneSameInstant(newZone).toLocalDateTime();
        return ConstantOperator.createDatetime(newDateTime);
    }
@Test
    public void convert_tz() {
        ConstantOperator olddt = ConstantOperator.createDatetime(LocalDateTime.of(2019, 8, 1, 13, 21, 3));
        assertEquals("2019-07-31T22:21:03",
                ScalarOperatorFunctions.convert_tz(olddt,
                        ConstantOperator.createVarchar("Asia/Shanghai"),
                        ConstantOperator.createVarchar("America/Los_Angeles")).getDatetime().toString());

        ConstantOperator oldd = ConstantOperator.createDate(LocalDateTime.of(2019, 8, 1, 0, 0, 0));
        assertEquals("2019-07-31T09:00",
                ScalarOperatorFunctions.convert_tz(oldd,
                        ConstantOperator.createVarchar("Asia/Shanghai"),
                        ConstantOperator.createVarchar("America/Los_Angeles")).getDatetime().toString());
    }