Dates¶
CONVERDATE¶
Function that converts a date to a defined format. The initial date can be in datetime or character string format.
Function syntax:
<CONVERTDATE:[src_date_format]:[dst_date_format]:[date_to_convert]>
- src_date_format: initial format of the date to be converted.
- dst_date_format: destination format of the date to be converted.
- src_date_format and dst_date_format:
- DATE if the format is in filetime.
- STR-[Date_mask]: specify the date format using the following syntax:
- DD: day
- HH: hour
- MM: month
- SS: seconds
- II: minutes
- YY: year
- YYYY: year
- date_to_convert: date to be converted.
Use mode:
- The CONVERTDATE operation can be used in all “expression” type fields, such as COPY, MODVALUE, etc. operations. Date conversion may be necessary during provisioning in order to comply with an expected write format for comparison with another date.
- The date to be converted may come from an attribute and can therefore be retrieved using the SyncAttSrc or SyncAttDst keywords.
Examples of configuration:
- <ConvertDate:DATE:STR-DD/MM/YYYY:<SyncAttSrc:contract_end_date>>
- With contract_end_date = “2022-01-12 15:30:39.503”
- Result: 1/12/2022
CMPDATE¶
Function that compares two dates. It returns true (1) or false (0) depending on the result of the comparison:
- If Operation = GT, then the function returns “true” if date_1 > date_2+delta
- If Operation = LT, then the function returns “true” if date_1 < date_2+delta
Function syntax:
<CMPDATE:[date_1]:[date_2]:[operation]:[delta]>
- Date_1: date to compare with Date_2
- Date_2: date to compare with Date_1
- Operation: can take the following values
- GT: equal to “greater than”
- LT: equal to “less than”
- Delta: Number of days to add to date_2 to perform the comparison. Enter 0 if you want to compare the dates as they are.
Use mode:
- The CMPDATE operation can be used in all “expression” type fields, such as COPY, MODVALUE, etc. operations. Date_1 and date_2 must be in the same format in order to perform a comparison. See CONVERTDATE to convert a date format.
- The dates to be compared can come from an attribute and therefore be retrieved with the SyncAttSrc or SyncAttDst keywords.
- The dates to be compared must be in filetime format.
Examples of configuration:
- <CMPDate:<SyncAttSrc:contract_end_date>:<SyncAttSrc:date_fin>:GT:10>
- With contract_end_date = 01/12/2025 and end_date = 01/15/2025
- Result = false
- <CMPDate:<SyncAttSrc:contract_end_date>:<SyncAttSrc:date_fin>:LT:0>
- With contract_end_date = 01/01/2025 and end_date = 01/15/2025
- Result = true
CURRENTDATE¶
Returns the current date in “filetime” format.
Function syntax:
<CURRENTDATE>
Use mode:
- The CURRENTDATE keyword is used in operations or with other keywords such as CMPDATE or CONVERTDATE.