@Udf(description = "Converts a TIMESTAMP value from one timezone to another")
  public Timestamp convertTz(
      @UdfParameter(
          description = "The TIMESTAMP value.") final Timestamp timestamp,
      @UdfParameter(
          description =  "The fromTimeZone in java.util.TimeZone ID format. For example: \"UTC\","
              + " \"America/Los_Angeles\", \"PST\", \"Europe/London\"") final String fromTimeZone,
      @UdfParameter(
          description =  "The toTimeZone in java.util.TimeZone ID format. For example: \"UTC\","
              + " \"America/Los_Angeles\", \"PST\", \"Europe/London\"") final String toTimeZone
  ) {
    if (timestamp == null || fromTimeZone == null || toTimeZone == null) {
      return null;
    }
    try {
      final long offset = TimeZone.getTimeZone(ZoneId.of(toTimeZone)).getOffset(timestamp.getTime())
          - TimeZone.getTimeZone(ZoneId.of(fromTimeZone)).getOffset(timestamp.getTime());
      return new Timestamp(timestamp.getTime() + offset);
    } catch (DateTimeException e) {
      throw new KsqlFunctionException("Invalid time zone: " + e.getMessage());
    }
  }
@Test
  public void shouldConvertTimezoneWithOffset() {
    // When:
    final Object result = udf.convertTz(Timestamp.valueOf("2000-01-01 00:00:00"), "+0200", "+0500");

    // Then:
    assertThat(result, is(Timestamp.valueOf("2000-01-01 03:00:00")));
  }