Convert date format from YY-MM-DD to DD-MM-YYYY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 06:06 AM
Hi All,
In record producer we have one variable which is Date type, in employee center it is displaying as YY-MM-DD
I have requirement to change this from YY-MM-DD to DD-MM-YYYY in employee center form view and on the request information on the record should show in DD-MM-YYYY format.
I created script include and on change client script.
Script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 06:25 AM
Why to convert the date format?
The date format is shown as per logged in user's date format.
what's your actual business requirement?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 07:35 AM
Hi @Ankur Bawiskar ,
This is the requirement I have received from client they wanted to make consistent across for all the users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 09:51 AM
that's what I informed, it can't be consistent as the date format depends on the logged in user's date format.
User can change the date format anytime from preferences so your script will fail.
Please inform your customer about this.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 11:19 AM
Hi @Ankur Bawiskar,
sorry my requirement is different only for particular variable catalog item they wanted to
DD-MM-YYYY format
As soon as they open catalog item in portal, they want DD-MM-YYYY format for that particular variable, and it should stay same after submission also