Por favor encuentra a continuación el código que se utiliza:
public String convertTimeZone(String Input_Timestamp, String Timestamp_format, String From_Timezone, String To_Timezone, Container container) throws StreamTransformationException{
LibraryMethod(title="convertTimeZone", description="Convertir la hora de entrada de una zona horaria a otra", category="FL_DateTime", type=ExecutionType.SINGLE_VALUE)
public String convertTimeZone (
Argument(title="Input_Timestamp") String timestamp,
Parameter(title="Timestamp_format") String format,
Parameter(title="From_Timezone") String fromTZ,
Parameter(title="To_Timezone") String toTZ,
Container container)
throws StreamTransformationException
{
DateTimeFormatter formatter = DateTimeFormat.forPattern(format);
DateTimeZone originalTZ = DateTimeZone.forID(fromTZ);
DateTime fromDateTime = new DateTime(DateTime.parse(timestamp, formatter), originalTZ);
DateTime toDateTime = fromDateTime.withZone(DateTimeZone.forID(toTZ));
return formatter.print(toDateTime);
}