Date field displays in incorrect format on Short description field

riskay123
Mega Guru

Hello,

I have a catalog item form that contains a date field. The date format appears correctly when you look at it on the form before submitting and also on the RITM form after submitting (Australian date format is DD/MM/YYYY). 

 

I have added a script to copy this variable and one other to the short description field but the date on the short description field is displaying in reverse. How can I make the short description date display the same was the variable date.

 

Script is:

//Copy content from variable to RITM description field on RITM form.

current.short_description=current.short_description +" - "+current.variables.who_for +" - "+current.variables.start_date;

1 REPLY 1

newhand
Mega Sage

HI @riskay123 

getByFormat method may help you。

 

https://developer.servicenow.com/dev.do#!/reference/api/tokyo/server/no-namespace/c_GlideDateScopedA...

Please mark my answer as correct and helpful based on Impact.