Display current date and time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:02 PM - edited 03-22-2023 02:10 PM
Hello, I have a read only Date/Time field that I would like to default showing the current date and time. I have tried adding the below as the default value but doesn't seem to work:
javascript: new DateTime();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 03:51 PM - edited 03-22-2023 04:11 PM
Hi @Andre8
Follow the steps below
1. Right Click on the Date/Time Dictionary header record and select the view as Advanced.
2. In the Default Value section->checked the use dynamic default and the Value
3. This will resolve your issue.
In Case if above doesn't work you can try script as default value
javascript:new GlideDate();
Regards,
Ashir Waheed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 06:40 AM
Does this only work on Global tables? This isn't populating the date/time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 03:37 PM
Yes, It does work.
You can also try the other default value I mentioned.
If still not seeing the date check for followings
1. Check that there is no BR, UI policy or any client script that is clearing the Value for Date/Time field.