can't use 'gs.nowDateTime();' in scoped application

dave_edgar
Mega Guru

In a scoped application I'm allowed to use in my UI Action, what can I replace this with, can't find a simple answer:

current.resolved = gs.nowDateTime();

?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Dave,



use the following script in scripts background to get the current date/time in system



var gdt = new GlideDateTime();



current.resolved = gdt.getDisplayValue();



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Dave Edgar,



Can you also please hit like and mark answer as helpful since you were able to achieve your requirement. Thanks in advance.



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader