Integration Server 10.5 | Built-In Services Reference Guide | Datetime Folder | pub.datetime:increment
 
pub.datetime:increment
WmPublic. Increments or decrements a date and time by a specified amount of time.
Input Parameters
startDate
String Starting date and time.
startDatePattern
String Pattern in which the startDate value is specified. For more information about these pattern letters and symbols, see the Oracle Java API documentation for the DateTimeFormatter class.
endDatePattern
String Pattern in which to format the resulting date/time. For more information about these pattern letters and symbols, seethe Oracle Java API documentation for the DateTimeFormatter class.
If no endDatePattern is specified, the endDate will be returned in the format specified in the startDatePattern parameter.
timezone
String Optional. The time zone to use for parsing startDate and formatting endDate.
The service uses timezone to parse the startDate String and convert it from the time zone specified in the input, if one was provided. For example, if the timezone input parameter is MST and the startDate is "2019-02-21 11:30:00 EST", then the service converts the startDate time from EST to MST. The service uses timezone when formatting endDate as a String. That is, the timezone determines the time zone in which the service expresses the endDate.
locale
String Optional. Locale in which the endDate is to be expressed. If locale is not specified, Integration Server uses the value of the watt.server.session.locale.ignore server configuration parameter to determine whether the locale is obtained from the session used by the client that invoked the service or if the locale is the locale of Integration Server.
addYears
String Optional. The number of years to add to startDate. The value must be an integer between -2147483648 and 2147483647.
addMonths
String Optional. The number of months to add to startDate. The value must be an integer between -2147483648 and 2147483647.
addDays
String Optional. The number of days to add to startDate. The value must be an integer between -2147483648 and 2147483647.
addHours
String Optional. The number of hours to add to startDate. The value must be an integer between -2147483648 and 2147483647.
addMinutes
String Optional. The number of minutes to add to startDate. The value must be an integer between -2147483648 and 2147483647.
addSeconds
String Optional. The number of seconds to add to startDate. The value must be an integer between -2147483648 and 2147483647.
addMilliseconds
String Optional. The number of milliseconds to add to startDate. The value must be an integer between -2147483648 and 2147483647.
useSystemTimeZone
String Optional. Whether to use the system time zone to increment the date/time when the startDate value does not have a time zone.
Usually, the system time zone is the time zone from which the JVM that containsIntegration Server was launched. Note that it possible to modify the JVM time zone after the JVM launches.
Set to:
*false if the startDate does not include a time zone, the timezone parameter was not set, and you want to increment the date/time without being affected by a time zone. This is the default.
*true to use the system time zone when incrementing the startDate.
When useSystemTimeZone is false and no timezone is provided, the resulting endDate will not include a timezone.To match the behavior of pub.date:incrementDate, which produced a date/time that always included a time zone, set useSystemTimeZone to true.
useSameInstant
String Optional. Whether to use the same Instant, where Instant represents a moment on the timeline in UTC, or the same unzoned date/time when applying a different time zone. Using the same Instant will usually result in changes to the unzoned date/time when the time zone and its offset are applied. Not using the same Instant will result in the unzoned date/time being unchanged when the time is applied.
If useSameInstant is true, the pub.datetime:increment service uses the Instant (the absolute time with no time zones) to determine how the timezone value is used.
If useSameInstant is false, the pub.datetime:increment service uses the unzoned date/time and only changes the time zone.
The default is true.
Note:
For the purpose of this documentation, the term "unzoned date/time" is synonymous with the term "local date/time".
For example, if startDate is a date/time of "2019-02-25 08:25:00 CET" (Central European Time, UTC+1:00) and the specified timezone value is America/New_York (EST, UTC-5:00) , the value of useSameInstant has the following impact:
*If useSameInstant is true, then 2019-02-25 08:25:00 CET becomes 2019-02-25 02:25:00 EST
*If useSameInstant is false, then 2019-02-25 08:25:00 CET becomes 2019-02-25 08:25:00 EST
Output Parameters
endDate
String The incremented date and time.
Usage Notes
The pub.datetime:increment service replaces the pub.date:incrementDate service which is deprecated.
The pub.datetime:increment service can be used to decrement a date and time by specifying negative numbers. The addYears , addMonths , addDays , addHours , addMinutes , addSeconds , and addMilliSeconds input parameters can take positive or negative values.
The service ends with an exception if the format of the date specified in the startDate parameter does not match the format specified in the startDatePattern.
If you want to increment the minutes, seconds, or milliseconds, the the time; otherwise, the service ends with an UnsupportedTemporalTypeException. �
08T1:20:20.001Z. Otherwise, the service might show inconsistent results.
If endDatePattern includes a time zone, such as "z", then the input string and startDatePattern must also have time zone fields, or timeZone must be set, or useSystemTimeZone must be true. Otherwise the service ends with an error.
If you specify only the startDate, startDatePattern, and endDatePattern input parameters and do not specify any of the optional input parameters to increment the period, the pub.datetime:increment service just converts the format of startDate from startDatePattern to endDatePattern and returns it as endDate.
If you specify a value for timezone, the service ignores the useSystemTimeZone parameter value.
If you specify a value for timezone and the startDate includes a time zone, then the service uses the supplied timezone to convert the startDate time zone.
If you do not specify a value for timezone and the startDate includes a time zone, then the service uses the time zone in the startDate and ignores the useSystemTimeZone parameter.
If you do not specify a value for timezone, the startDate does not include a time zone, and useSystemTimeZone parameter is true, then the service uses the system time zone.
If startDate does not include a time zone, you do not specify a value for timezone, and useSystemTimeZone is false, the resulting endDate will not include a time zone.
The pub.datetime:increment service is similar to pub.date:incrementDate, however, the pub.datetime:increment service provides more specific handling of time zones. To match the behavior of pub.date:incrementDate, set useSameInstant to true.