Version: 1.4
Category: Process
Action Package: Standard Actions
Description
Convert a date value from one format to another. Date and Time Patterns may be found at: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Parameter |
Description |
Example |
Session Attribute with Date Value |
Enter the session attribute containing the date value to be converted. Optional if Origin Date Format is set to ‘Current’ and a Result Session Attribute is configured, else mandatory. No default value. |
whenCreated |
Session Attribute for the Result |
Enter a session attribute name where the converted date value should be placed. Leave empty to place the result in the original session attribute. Default value is empty. |
whenCreatedCustom |
Origin Date Format |
Enter the origin date format to be converted from (case sensitive): Generalized, Microsoft, Unix, Current or Custom;Format. Example: ‘Generalized’ or ‘Current’ or ‘Custom;yyyy.MM.dd G ‘at’ HH:mm:ss z’. No default value. |
Generalized |
Target Date Format |
Enter the target date format that the origin date format shall be converted to (case sensitive): Generalized;UseUTC=true/false (Default: false), Microsoft;UseUTC=true/false (Default: false), Unix, or Custom;Format. Example: ‘Generalized;UseUTC=true’ or ‘Unix’ or ‘Custom;yyyy.MM.dd G ‘at’ HH:mm:ss z’. No default value. |
Custom;yyyy-MM-dd |
Generalized Time Format |
Generalized Time can use the short ending ‘Z’ or the long ending ‘.0Z’. Enter the format for the target date (short/long). Default uses the same format as in the origin date if that format is generalized time, otherwise the short ending will be used. |
long |
Add or Remove Time |
To add or remove days or minutes to the date value, use +/-Days;+/-Minutes. Example: ‘-2;18’ to remove 2 days and add 18 minutes, or ‘;-120’ to remove 120 minutes. No default value. |
1;180 |
Session Attribute for Status |
Enter a session attribute name for ‘Status’. The ‘Status’ attribute value indicates SUCCESS or ERROR. Default value is empty. |
whenCreatedConversionStatus |
Remove if After |
Remove the session object if the value in the date attribute is after the current time +/- a given number of days and/or hours. The number of days and hours are entered in the format +/-Days;+/-Minutes. Examples: ‘-2;-60’ to remove the object if the time is after 2 days and 1 hour ago. ‘;120’ to remove the object if the time is after the current time plus 120 minutes. Leave empty to not use this option. Default value is empty. |
-1;0 |
Remove if After Attribute |
Remove the session object if the value in the date attribute is after the date in this configured session attribute. The value in this attribute must have the same format as entered as target date format. ‘Target Date Format’ has to be configured without the UseUTC option. Leave empty to not use this option. Default value is empty. |
expireDate |
Remove if Before |
Remove the session object if the value in the date attribute is before the current time +/- a given number of days and/or hours. The number of days and hours are entered in the format +/-Days;+/-Minutes. Examples: ‘-2;-60’ to remove the object if the time is before 2 days and 1 hour ago. ‘;120’ to remove the object if the time is before the current time plus 120 minutes. Leave empty to not use this option. Default value is empty. |
2;-30 |
Remove if Before Attribute |
Remove the session object if the value in the date attribute is before the date in this configured session attribute. The value in this attribute must have the same format as entered as target date format. ‘Target Date Format’ has to be configured without the UseUTC option. Leave empty to not use this option. Default value is empty. |
startDate |
Use Cases
Example 1: Convert date from custom format to Microsoft time format
The date attribute endDate has been fetched from an SQL database and must be converted to Microsoft time format before being written to Active Directory as the attribute accountExpires.
Parameter |
Value |
Session Attribute with Date Value |
endDate |
Session Attribute for the Result |
accountExpires |
Origin Date Format |
Custom;yyyy-MM-dd |
Target Date Format |
Microsoft |
Generalized Time Format |
[BLANK] |
Add or Remove Time |
[BLANK] |
Session Attribute for Status |
endDateConversionStatus |
Remove if After |
[BLANK] |
Remove if After Attribute |
[BLANK] |
Remove if Before |
[BLANK] |
Remove if Before Attribute |
[BLANK] |
Example 2: Create a session attribute containing the date 7 days ahead
To filter the session objects with a date attribute containing a date that will occur at least 7 days ahead, we have to create a session attribute containing the date 7 days ahead. Using that, we can make a compare with the Action Compare Values.
Parameter |
Value |
Session Attribute with Date Value |
[BLANK] |
Session Attribute for the Result |
dateSevenDaysAhead |
Origin Date Format |
Current |
Target Date Format |
Generalized |
Generalized Time Format |
[BLANK] |
Add or Remove Time |
7; |
Session Attribute for Status |
dateSevenDaysAheadStatus |
Remove if After |
[BLANK] |
Remove if After Attribute |
[BLANK] |
Remove if Before |
[BLANK] |
Remove if Before Attribute |
[BLANK] |
Example 3: Remove objects older than 30 days
To remove objects that are older than 30 days, we use the “Remove if Before” and “Remove if Before Attribute” parameters. When we set “Remove if Before” to -30, we well subtract 30 days from the current date, and then remove all objects that are older than that.
Parameter |
Value |
Session Attribute with Date Value |
myDateAttribute |
Session Attribute for the Result |
[BLANK] |
Origin Date Format |
Custom;yyyy-MM-dd HH:mm:ss |
Target Date Format |
Custom;yyyy-MM-dd HH:mm:ss |
Generalized Time Format |
[BLANK] |
Add or Remove Time |
[BLANK] |
Session Attribute for Status |
[BLANK] |
Remove if After |
[BLANK] |
Remove if After Attribute |
[BLANK] |
Remove if Before |
-30 |
Remove if Before Attribute |
myDateAttribute |
DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.
PhenixID - support.phenixid.se