- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2018 01:51 PM
Hello,
I need to change the format of a specific date field on an HR case form from short (MM/DD/YYYY) to long (MMM DD, YYYY).For instance, 03/28/2108 should be March 28, 2018. I need to change the date format only for a single field and not across the system (I am on Kingston)
I tried creating a new System Property (long_date_format) and adding it to the Attribute in the Dictionary Entry of the field, but couldn't get it to work. I am thinking I might need to use a script include, but I am new to scripting. So before I try that, first wanted to check with you folks to see if there is an easier solution. If anyone could point me in the right direction, that would be really helpful!!
Many thanks!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018 05:45 PM
- Create a New Field called 'Long Date' of type String
- Click 'Advanced View'
- On 'Calculated Value' tab, check 'Calculated'
- Insert the code below into the 'Calculation' field, substituting 'resolved_at' with your field
(function calculateLongDate(current) {
var gDateTime = new GlideDateTime(current.resolved_at.getDisplayValue());
var gDate = gDateTime.getDate();
var longDateTime = gDate.getByFormat('MMMM dd,YYYY');
return longDateTime;
})(current);
- Add the field to the form, under your Date field (example below)
Date/Time formats are documented here.
Similar to the Business Rule solution, it only updates on form load.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2021 03:52 AM
Hi Paul,
The suggested script worked for me. Can you also let us know how the time entered in the field "Resolved" can be changed to "5.30PM".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2021 01:35 AM
4 years later, still helpful. Many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2023 11:48 AM
This is 'gold'.
Thank you.