
AaronA.56027 (Customer) asked a question.
Recently I had a requirement to calculate Okta profile attribute values based on derived hire date values (App -> Okta). For instance, populate the secondary email address up to 14 days after the hire date or set the account end date to one year from the hire date.
After doing some research and trial and error I found a way to do this. Here is the process:
- Identify the app attribute that contains the source date - appuser.LastHireDate
- Ensure it is in the full ISO862 format - i.e. if appuser.LastHireDate is 2021-09-20T00:00:00 then append ".000Z"
- Convert it to Unix format - Time.fromIso8601ToUnix(=>)
- Truncate the milliseconds, otherwise the number will be too large to fit into a 32 bit Integer - substring(=>,0,10)
- Convert the value into an Integer - Convert.toInt(=>)
- Add or subtract the number of seconds desired (i.e. +1 year = 31536000) - => + 31536000
- Convert the number back to a string and re-append the milliseconds placeholder zeros - (=> + "000")
- Finally convert the Unix date format back to ISO862 Time.fromUnixToIso8601(=>) which should now reflect the date modification.
Here is an example expression integration mapping:
substring(Time.fromUnixToIso8601((Convert.toInt(substring(Time.fromIso8601ToUnix("2021-09-20" +"T00:00:00.000Z"),0,10)) + 31536000)+"000"),0,10)
where the source date "2021-09-20" evaluates to "2022-09-20"
Hopefully others will find this useful and avoid having to perform redundant workflow and Okta sourced profile attribute workarounds.

Hi @AaronA.56027 (Customer) , Thank you for sharing with the Okta Community, this is great info to have!
--
Help others in the community by liking or hitting Select as Best if this response helped you.
Collect them all. Learn a new skill and earn a new Okta Learning badge.
Just released: More Okta Community badges just added