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.

getByFormat is not working as expected!?

Ravi Chandra_K
Kilo Patron
Kilo Patron

find_real_file.png

the expected output is 2005-01-31 but I'm getting 0036-06-27. how to resolve this?

 

find_real_file.png

1 ACCEPTED SOLUTION

Muhammad Khan
Mega Sage

Hi Kukunooru,

 

Use the following in background script;

var gd = new GlideDateTime();
gd.setValue('31-03-2005');
gs.print(gd.getDate());
*** Script: 2005-03-31

Hopefully, this will resolve your query.

View solution in original post

20 REPLIES 20

Hi Muhammad! it is working now.

instead of setValue(), I have used setDisplayValue()