DateTimeUtil Factory

There is a built-in factory named DateTimeUtil. This factory provides access to methods used in creating Duration objects.

Method Return Value Description
createDuration(Boolean isPositive, Integer years, Integer months, Integer days, Integer hours, Integer minutes, Integer seconds)
Duration Creates a Duration object that can then be used to set as a value on duration controls, the value on parameters or data fields of type Duration, or as attributes of complex objects with type Duration.

Example usage:

var duration = factory.DateTimeUtil.createDuration(true,1,3,12,12,32,20);