Changing the date format from MM/DD/YYYY to YYYY-MM-DD might cause some errors or unexpected results.
- User Lifecycle Management
- Okta Expression Language
This expression will achieve the format change:
Time.fromIso8601ToString((Time.fromStringToIso8601(appuser.extensionAttribute4,"MM/DD/YYYY")),"YYYY-MM-DD")
Please consider that it always changes the month to 01, regardless of the month number coming from the Active Directory.
Multiple syntax solutions are available, including these two examples:
- Change both instances of the upper case "MM" in the expression to lower case "mm" while keeping "DD" and "YYYY" the same.
- Time.fromIso8601ToString((Time.fromStringToIso8601(appuser.extensionAttribute4,"mm/DD/YYYY")),"YYYY-mm-DD")
- Keep the "MM" instances the same and change the "DD" and "YYYY" instances to "dd" and "yyyy".
- Time.fromIso8601ToString((Time.fromStringToIso8601(appuser.extensionAttribute4,"MM/dd/yyyy")),"yyyy-MM-dd")
