Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to convert the any date time to yyyy-MM-dd "2024-12-30 08:14:54

shashanksha
Tera Contributor

How to convert the any date time format  into yyyy-MM-dd "2024-12-30 08:14:54" this format. My requirement is that i want the datetime to be in System(yyyy-MM-dd) format.

 

Thanks,

Shashank Sharma

5 REPLIES 5

In that case, try to play with the below script and adjust accordingly, you can use the background script to see it for the current date and time:

var gdt = new GlideDateTime();
gs.info(gdt);

 

Perhaps check the instance time format property

_____
This reply is 100 % GlideFather and 0 % AI