dateAddSubtractFormat
def dateAddSubtractFormat = {dateTimeString, periodString, isAdd = true, isMinute = true, includeTime = true ->
xxx
}
Adds or subtracts time periods from dateTime and transforms values into ISO date-time format.
Parameter
Description
Default Value
dateTimeString
dateTime string in one of the following formats:
yyyy-MM-dd'T'HH:mm:ss.SSSZ
yyyy-MM-dd HH:mm:ss
yyyy-MM-dd
periodString
The time period to add or subtract.
isAdd
Specifies whether to add or subtract.
true
isMinute
Specifies whether time units are in minutes.
true
includeTime
Specifies whether formatted date-time values include time values.
true
Example
"svmx_start_datetime": "dateAddSubtractFormat(fields.StartDateTime, fields.SVMXC__Driving_Time__c)"
In this example, if the value of StartDateTime is 2018-07-29 16:22:33, and the value of SVMXC__Driving_Time__c is 10, then the value of svmx_start_datetime is 2018-07-29 16:32:33.
For Date data type transformations, set includeTime to false:
"svmx_start_date": "dateAddSubtractFormat(fields.StartDateTime, fields.SVMXC__Driving_Time__c, true, true, false)",
In this example, if the value of StartDateTime is 2018-07-29 16:22:33, the value of svmx_start_date is 2018-07-29.
For more information:
escape
ifelse
Was this helpful?