ReferenceError: GlideDateTime is not defined function

dipesh1
Kilo Contributor

I get the following error on running this code:

var start = new GlideDateTime("2011-01-01 12:00:00");

var end = new GlideDateTime(start);

alert(end);

error:ReferenceError: GlideDateTime is not defined function

Any Ideas?

1 ACCEPTED SOLUTION

Hi Dipesh,



Make sure the client box is unchecked in UI Action.


View solution in original post

6 REPLIES 6

edwin_munoz
Mega Guru

Hello Dipesh,



It seems that you need to use GlideDateTime on a client script, when it is only supported from server side: GlideDateTime - ServiceNow Wiki



What are your full requirements for your script?



Thank you.


Hi Edwin



You're right.




Just realized the mistake.



Trying to print the GlideDateTime object in a UI action now.



But it is not printing. I am on Dublin version.



Any comments?


Hi Dipesh,



Make sure the client box is unchecked in UI Action.


Hi Pradeep



Thanks.. Got it...