Can we use okta expression language to do a date or timestamp comparison? Skip to main content
https://support.okta.com/help/answers?id=9060z00000078j5qai&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Gayathri SekarGayathri Sekar 

Can we use okta expression language to do a date or timestamp comparison?

Here's what I'm looking to achieve: I'm trying to create a rule for groups, which looks at a user's join date in the profile and then needs to put them into a group.
So I need to check if a user's join date is less than or equal to the current date and if yes, put them into a group.
The format of joining date (string) in the user profile is like this : "joinDate": "2018-07-03T00:00:00.000Z"
How do I use OKta expression language to compare this string with the current time and then use the result to put the user in a group


Gayathri
Paul StinigutaPaul Stiniguta (Okta, Inc.)
Hello Gayathri,

I would assume that the users have the attribute for join date and of course a value for that. In this case when you add a Group Rule and the expression should look something like this: user.joinDate<="Time.now(EST)"
I have run a test on my end and was able to make it work.
In case you have more questions regarding this, don't hesitate to open a ticket with support.

Paul Stiniguta
Technical Support Engineer
Okta Global Customer Care