Saw your post on other social media, check the below code if that helps, I had written this for one of the clients in the past, also, look at thread How to convert timezone in ESB service - webMethods - Software AG Tech Community & Forums
public static final void formatDateTimeZone (IData pipeline)
throws ServiceException
{
// --- <<IS-START(formatDateTimeZone)>> ---
// @sigtype java 3.5
// [i] field:0:required inString
// [i] field:0:required currentPattern
// [i] field:0:required newPattern
// [i] field:0:required timezone
// [o] field:0:required value
IDataCursor cursor = pipeline.getCursor();
String inString = IDataUtil.getString( cursor, "inString" );
String currentPattern = IDataUtil.getString( cursor, "currentPattern" );
String newPattern = IDataUtil.getString( cursor, "newPattern" );
String timezone = IDataUtil.getString( cursor, "timezone" );
SimpleDateFormat format = new SimpleDateFormat( currentPattern );
format.setLenient(false);
Date currentDate;
try
{
currentDate = format.parse(inString );
}
catch( Throwable t )
{
cursor.destroy();
throw new ServiceException(t);
}
format = new SimpleDateFormat(newPattern);
format.setTimeZone(TimeZone.getTimeZone(timezone));
String value = format.format(currentDate);
IDataUtil.put(cursor, "value", value);
cursor.destroy();
// --- <<IS-END>> ---
}
#Integration-Server-and-ESB#B2B-Integration#webMethods