We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Check date based on user date preference

eashwar
Tera Contributor

Hello Folks,

Need your expert suggestion.

I have a field in my service catalog which check for date previous than current date but we recently found that users are changing date preference from system preference mm-dd--yy.

is there a good way or code to check this functionality if they are in any format ?

Thank you,

Eashwar Elumalai

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee

You can use g_user_date_format to grab the logged in user's date format in a client script. Here are some resources to check for how it's used.



Client Script to account for date format?


Comparing Client Dates


View solution in original post

2 REPLIES 2

Brad Tilton
ServiceNow Employee

You can use g_user_date_format to grab the logged in user's date format in a client script. Here are some resources to check for how it's used.



Client Script to account for date format?


Comparing Client Dates


Thank you Brad. That was helpful