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

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */