- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 10:53 AM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 11:00 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 12:18 PM
Yup so for that you can use the function which I provided earlier :
var gDate = new GlideDate(); gDate.setValue('2015-01-01'); gs.info(gDate); var gDT = new GlideDateTime(gDate); gs.info(gDT);
This will convert your Glide Date to Glide Date Time without manually inputting anything. try this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 01:14 PM
This isn't a constructor that is available on Kingston.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 02:34 PM
Sorry man couldn't figure this out in Kingston. I would suggest raise another question on this community with your exact requirements and somebody should be able to help you out.
Happy coding.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 02:54 PM
Hey nw! Thanks for all the help 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2019 11:03 AM
Check below blog for time format converting
https://community.servicenow.com/community?id=community_blog&sys_id=bc0e6a2ddbd0dbc01dcaf3231f961931
Regards,
Sachin