This category contains Ruleset Actions that work in conjunction with the DateTime variable type and can be used to manipulate date-time values in your data without the need for manual editing or custom rules. Each Action is described below.
Video: See the Cleo Community Video on conditioning a rule using Date-Time Actions.
Related Info: Please refer to additional documentation for more information and details on syntax usage.
AddDateTime
Adds two DateTime values (Addend1 and Addend2) and returns a DateTime value.
- If one of the values is null, the other will be returned.
- If both values are null then null will be returned.
AddDateTimeWithFields
Adds value(s) – Year, MonthOfYear, DayOfMonth, HourOfDay, MinuteOfHour, Seconds – to a DateTime value (DateTime) and returns a DateTime value.
Example:
Adding 2 months and 4 hours to 2023-10-27T14:08:35.618-04:00 returns 2023-12-27T18:08:35.618-05:00
Note: This replaces the older AddDays and AddHours Actions.
CreateDateTime
Creates a DateTime value based on inputs: Year, MonthOfYear, DayOfMonth, HourOfDay, MinuteOfHour, Seconds.
Property | Type | Description |
---|---|---|
Year | Number | The year. |
MonthOfYear | Number | The month of the year, from 1 to 12. |
DayOfMonth | Number | The day of the month, from 1 to 31. |
HourOfDay | Number | The hour of the day, from 0 to 23. |
MinuteOfHour | Number | The minute of the hour, from 0 to 59. |
Seconds | Number | The second of the minute, from 0 to 59. |
- Ignores any property that is null.
- Throws an IllegalArgumentException if one of the fields is out of range.
CreateDateTimeFromMilliseconds
Creates a DateTime value from milliseconds (DateTimeMilliseconds); allows for indicating Century Included.
CreateDateTimeFromString
Creates a DateTime value from a string value (DateTimeString) described by a specified FormatPattern.
Example:
DateTimeString: 2016/05/31 11:22:10
FormatPattern: yyyy/MM/dd HH:mm:ss
Return: 2016-05-31T11:22:10.000-04:00
CreateDateTimeFromStringWithTimeZone
Creates a DateTime value from a string value (DateTimeString) described by a specified FormatPattern using a specified TimeZone (such as GMT).
DateTimeEquals
Determines if two DateTime values (SourceString1 and SourceString2) are equal and returns a Boolean value.
- If equal, returns true.
- If both are null, returns true.
- If one is null, returns false.
DateTimeNotEquals
Determines if two DateTime values (SourceString1 and SourceString2) are not equal and returns a Boolean value.
- If both are equal, returns false.
- If both are null, returns false.
- If one is null, returns true.
FormatDateTime
Converts a DateTime value (DateTime) to a formatted (Pattern) string. This replaces the older action ConvertDateFormat.
Example:
Pattern EEEEE_MMMMM_dd_yyyy_HH_mm_ss returns "Friday_October_27_2023_12_54_33"
FormatDateTimeWithTimeZone
Used to convert a DateTime value (DateTime) to a formatted string (Pattern) using a specified Time Zone (such as HST).
Property | Type | Description |
---|---|---|
DateTime | DateTime | DateTime to be converted |
Pattern | String |
The pattern syntax. (mostly compatible with java.text.SimpleDateFormat)
Example: Pattern EEEEE_MMMMM_dd_yyyy_HH_mm_ss_ZZZ returns "Friday_October_27_2023_06_54_33_HST"
|
TimeZone | String | Sources for Time Zone and Daylight Saving Time Data come from the public domain tz database; also referred to as the Olson database. |
Please refer to additional documentation for more information and details on syntax usage.
- https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
- https://data.iana.org/time-zones/tzdb-2018g/tz-link.html#:~:text=The%20tz%20database,boundaries%20and%20daylight%20saving%20rules.
GetCurrentDateTime
Creates a DateTime value based on the Integration Server’s current setting.
GetDayOfMonth
Determines the day of the month (a numeric value from 1 to 31) from a DateTime value (DateTime).
GetDayOfWeek
Determines the day of the week (a numeric value from 1 to 7) from a DateTime value (DateTime).
GetDayOfYear
Determines the day of the year (a numeric value from 1 to 366) from a DateTime value (DateTime).
GetDaysBetween
Determines the number of days between two DateTime values (Minuend and Subtrahend).
GetHourOfDay
Determines the hour of the day (a numeric value from 0-23) from a DateTime value (DateTime).
GetMilliseconds
Determines the number of milliseconds since 1970, 00:00:00 GMT from a DateTime value (DateTime).
GetMinuteOfHour
Determines the minute of the hour (a numeric value from 0-59) from a DateTime value (DateTime).
GetMonthOfYear
Determines the month of the year (a numeric value from 1-12) from a DateTime value (DateTime).
GetSecondOfMinute
Determines the second of the minute (a numeric value from 0-59) from a DateTime value (DateTime).
GetYear
Determines the year from a DateTime value (DateTime) and returns a 4-digit numeric value.
SubtractDateTime
Subtracts a DateTime value (Subtrahend) from another DateTime value (Minuend) and returns a DateTime value.
SubtractDateTimeWithFields
Subtracts value(s) -- Year, MonthOfYear, DayOfMonth, HourOfDay, MinuteOfHour, Seconds – from a DateTime value (DateTime) and returns a DateTime value.
Example:
Subtracting 1 year and 3 days from 2023-10-27T14:17:43.977-04:00 returns 2022-10-24T14:17:43.977-04:00
Comments
0 comments
Please sign in to leave a comment.