We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Extract the date from GlideDateTime()

carlocsa
Kilo Expert

Hello Experts!

How do I extract or use the date from GlideDateTime()?

Thank you!

Carlo

1 ACCEPTED SOLUTION

Shishir Srivast
Mega Sage

Please try,



var sdt = new GlideDateTime();


var dt = sdt.getDisplayValue().split(' ')[0];


gs.print(dt);


View solution in original post

5 REPLIES 5

CataCamp
Kilo Contributor

This is what I have done:

 

var today = new GlideDate();

// formats to yyyy-mm-dd
var displayDate = today.getDisplayValue(); 

return displayDate;

 

CataCamp_0-1745597257577.png