Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Validation on Date/Time field for user profile timezone On submission

Mohankumari
Kilo Contributor

Hi all,

I have added date/time field in one of my form in service portal.I want to validate on submission of request.( Due to some restrictions I cant use script include and business rule)

 

I have set my user profile timezone to NYT. 

 

When I add value in date/time field (2026-03-20 10:15:00)  and when I click on submit button on service portal at (2026-03-20 10:17:00). It should validate the date/time with current user profile timezone, if it's expired or past date/time.It should block the submission.

 

I tried g_user_date_time_format but it is comparing the value in date/time field with the local time(PC time). 

 

How to troubleshoot this scenario.

 

 

Thanks in Advance!

 

Mohankumari 

5 REPLIES 5

Mohankumari
Kilo Contributor

I tried this approach on g_user_date_time_format.

 

So here what's happening is  I have set my servicenow user profile time zone to NYT and browser timezone is IST.

for the above approach, on the date/time field ,when I click on date on calendar picker , by default it will show NYT time, when I click on submit it is validating if the entered date/time is in IST time(browsers time) and validating against browers time with the user profile time, and also in the RITM and email , date/time created as user profile timezone and convert it to GMT. 

 

so the g_user_date_time_format provide wrong validation on submit in my case.

 

Thanks for your take on this !