Generalized Time conversion to MM/dd/YYYY format

Hey everyone,

I’m having trouble grasping how to take datetime (“2017-04-11T04:00:00.000Z”) and output it as MM/dd/YYYY, or for bonus points, how to do that but also convert it to a string.

I am passing two attributes up from Active Directory for both Start and Termination date using Generalize Time formatting to Okta Universal Profile, from there I need to make it readable by a third party app.

If anyone could provide guidance it would be greatly appreciated, thank you.

The third party company had given me this as an example, but I don’t know how to correctly modify the expression. however I get Invalid expression syntax.

(Time.fromIso8601toString(user.hiredate,“MM/dd/YYYY”),‘T’)

My value is user.hireDate

In case someone else comes across this needing to manipulate date/time formats with Okta, the example above should work with:

Time.fromIso8601ToString(user.hiredate,“MM/DD/YYYY”)

I also had to convert had to convert a string from “YYYY-MM-DD” to “MM/DD/YYYY”, and was able to do so successfully with:

Time.fromIso8601ToString((Time.fromStringToIso8601(user.hiredate,“YYYY-MM-DD”)),“MM/DD/YYYY”)

**You may need to change user.hiredate depending on the variable name you use in your Okta user profile.

https://developer.okta.com/docs/reference/okta-expression-language/#time-functions