Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

How to populate current date and time in field?

RAM75
Tera Contributor

How to populate current date and time in field?

Note: that field should be in read only mode.

Thanks

1 ACCEPTED SOLUTION

Hi,

Remember -> new GlideDateTime() will work in both global and custom scope application

find_real_file.png

Regards
Ankur

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

View solution in original post

3 REPLIES 3

Pranav Bhagat
Kilo Sage

Set the default value of the field with the 

 

In Default value use javascript:gs.nowDateTime();

Ankur Bawiskar
Tera Patron

Hi,

you can use default value in the field

javascript: new GlideDateTime();

Then make it read-only at dictionary level itself if it is always read-only

Regards
Ankur

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

Hi,

Remember -> new GlideDateTime() will work in both global and custom scope application

find_real_file.png

Regards
Ankur

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