ServiceNow Learning#21 : Get Date/Time format in Scoped APP in ServiceNow

Shamma Negi
Kilo Sage
Kilo Sage

Hi All,

 

If you want to get the current date in Scoped APP in ServiceNow. It will give you the current system time. It means the time according to system Time Zone selected. 

 

var gdtme= new GlideDateTime(); //To get the current system Time

gs.info ("Current Time by Shamma: " + gdtme);

 

Output:

Current Time by Shamma 2023-08-16 14:00:00

 If you want to fetch the data/time from any field on form then do this:

 

var gdtme= new GlideDateTime(current.<field_name>); //To get the data/time filled in the field mentioned here.

gs.info ("Date/Time in field on form by Shamma: " + gdtme);

 

Thanks,

Shamma

Regards,Shamma Negi
0 REPLIES 0