Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Change sys_created_on date/time format from (yyyy-MM-dd HH:mm:ss) to (yyyy-MM-dd'T'HH:mm:ss.SSSZ)

Not applicable

How to Change/convert sys_created_on date/time format from (yyyy-MM-dd HH:mm:ss) to (yyyy-MM-dd'T'HH:mm:ss.SSSZ) in scoped application.

example:

2023-09-01 13:38:23
2023-09-06T07:46:06.523Z

 

1 REPLY 1

Cruz Melendi
ServiceNow Employee

Hi,

 

This article might help you : https://www.servicenow.com/community/service-management-forum/how-to-convert-servicenow-ticket-creat...

 

This is one code you could use:

var incCreatedOn = current.getValue('sys_created_on');
var gdt = new GlideDateTime(incCreatedOn);
var createdOnDate = new Date(gdt.getNumericValue());
var isoDate = createdOnDate.toISOString();