<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z0000A4qgEnCQIOkta Classic EngineUniversal DirectoryAnswered2026-02-17T09:00:23.000Z2024-05-22T22:00:22.000Z2024-05-31T17:20:27.000Z

StaceyS.22475 (Hyland Software, Inc.) asked a question.

Custom Profile Attribute Date Conversion not working

I' trying to convert the AD attribute accountExpires to a standard readable date in my Okta profile, but I can't get it to work.

 

I followed this Okta KB: https://support.okta.com/help/s/article/How-to-convert-Active-Directory-accountExpires-into-date-format?language=en_US

 

I added the custom attribute accountExpires to my Okta default profile and then mapped it to the AD attribute accountExpires

 

and used the expresion appuser.accountExpires != '9223372036854775807' ? Time.fromIso8601ToString(Time.fromWindowsToIso8601(appuser.accountExpires),"dd-MM-YYYY") : ""

(I replaced the '9223372036854775807' with the string found in my users okta profile '133635024000000000'

 

but it's not converting.

 

 

 

 

 


  • nfmez (nfmez)

    Hello @StaceyS.22475 (Hyland Software, Inc.)​ Thank you for posting on our Community page!

     

    The expression provided in that document needs to be used as it is, you do not need to make any changes to it. The reason for it not working is because you changed the value 9223372036854775807 to something else. Please try with this and let me know how it goes:

    appuser.accountExpires != '9223372036854775807' ? Time.fromIso8601ToString(Time.fromWindowsToIso8601(appuser.accountExpires),"dd-MM-YYYY") : ""

     

    Thank you for reaching out to our Community and have a great day!

    --

    Join the discussion for the Ask Me Anything online event on May 23, 2024 with Okta Tactical Edge Product Experts

    Expand Post
    Selected as Best
  • nfmez (nfmez)

    Hello @StaceyS.22475 (Hyland Software, Inc.)​ Thank you for posting on our Community page!

     

    The expression provided in that document needs to be used as it is, you do not need to make any changes to it. The reason for it not working is because you changed the value 9223372036854775807 to something else. Please try with this and let me know how it goes:

    appuser.accountExpires != '9223372036854775807' ? Time.fromIso8601ToString(Time.fromWindowsToIso8601(appuser.accountExpires),"dd-MM-YYYY") : ""

     

    Thank you for reaching out to our Community and have a great day!

    --

    Join the discussion for the Ask Me Anything online event on May 23, 2024 with Okta Tactical Edge Product Experts

    Expand Post
    Selected as Best
This question is closed.
Loading
Custom Profile Attribute Date Conversion not working