check date format in server side??

Kiddy1
Tera Contributor

Hello 

 

I am setting date in the field 

i have to make a validation whether the date sent in json is in format dd/mm/yyyy hh:mm:ss

i get json data as

{

"Receipt_Date_Time" : "24/10/2018 01:51:57"

}

i need to validate it is respected the correct format script would be helpful

 

thanks in advance

1 REPLY 1

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi Kiddy,

you can use the GlideDateTime for validating it.

There is example there.

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thanks you

Cheers
Alberto