How to change format of javascript:new GlideDate();

Luis Roman
Kilo Guru

I have a catalog item variable with a default value of javascript:new GlideDate(); However, need to change the format to MM-DD-YYYY. Can someone let me know how to do that I am not verse in scripting and the help will be appreciated.

Thank you very much, Luis

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

You can use below format:

var date= new GlideDate();
gs.info(date.getByFormat('dd-MM-YYYY'));

 

 

Best Regards
Aman Kumar

View solution in original post

3 REPLIES 3

Aman Kumar S
Kilo Patron

You can use below format:

var date= new GlideDate();
gs.info(date.getByFormat('dd-MM-YYYY'));

 

 

Best Regards
Aman Kumar

Got it Kumar,thank you for always help me and educate me in scripting.

Always a pleasure 🙂

Best Regards
Aman Kumar