- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 02:51 AM
Hi Team,
i am using sys_updated_on field in notification but time stamp is coming when i am using ${sys_updated_on} like this "2023-08-22 12:42:51" i want to remove time from this i have created mail script for this but its not working sharing the script can anyone help me in the script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 03:46 AM
you can use this in email script
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gdt = new GlideDateTime(current.sys_updated_on);
var date = gdt.getLocalDate();
template.print(date);
})(current, template, email, email_action, event);
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
02-06-2025 03:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 03:21 AM
Hello @shabbir9 ,
You can use OOB GlideDate() functionality.
var updatedValue = current.getValue('sys_updated_on');
var newUpdatedValue = new GlideDate('updatedValue');
template.print(newUpdatedValue);
If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 03:25 AM
If my response finds helpful, please indicate its helpfulness by selecting Accept as Solution and Helpful.
Thanks,
Vaibhav Nikam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 03:46 AM
you can use this in email script
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gdt = new GlideDateTime(current.sys_updated_on);
var date = gdt.getLocalDate();
template.print(date);
})(current, template, email, email_action, event);
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