// First import DateUtils. This class has a few apis that make it easy to add a value to a date. var DateUtils = org.apache.commons.lang.time.DateUtils; // Extract the start date from the message var appointmentStartTime = qie.deduceDate(source.getNode("SCH-11.4")); // Extract the duration from the message and convert it to an int. Times one will only work if this is just a number. var durationInMinutes = source.getNode("SCH-9")*1; // Use DateUtils to create a new date with the minutes added. To subtract add a negative number instead of a positve number var appointmentEndTime = DateUtils.addMinutes(appointmentStartTime, durationInMinutes); // Put the end time in the message message.setNode("SCH-11.5", qie.formatDate('yyyyMMddHHmmss', appointmentEndTime));
For more ways to use DateUtils see: http://commons.apache.org/proper/commons-lang/javadocs/api-2.3/index.html?org/apache/commons/lang/time/DateUtils.html