Convert format of glidedatetime from YYYY-MM-DD to YYYY-MMM-DD

PranavSuj96
Mega Expert

Hello all,

 

I have a script include which gets me tomorrow's date. However it sends it back to my client script in the wrong format.

 

I tried using getByFormat("YYYY-MMM-DD HH:MM:SS") on the GDT variable, however this functionality is not available on KINGSTON. Not sure how to proceed...

 

Thanks

Pranav

1 ACCEPTED SOLUTION

Abhishek Pidwa
Kilo Guru

Hi , 

 

It seems that this function is still available on Kingston and I tried in my PDI to test it. Can you post the entire script as to how are you using that function ?

 

https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_ScopedGlideDateGetByFormat_String

 

var gd = new GlideDate();
gd.setValue('2015-01-01');
gs.info(gd.getByFormat("dd-MMM-yyyy HH:MM:SS"));

 

Thanks.

View solution in original post

10 REPLIES 10

Harsh Vardhan
Giga Patron

have you checked the basic configuration ui16  properties. what exactly it has set in data format 

 

find_real_file.png