- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 11:35 PM
Need a script to add 7 days to current date in default value section of date/time variable of record producer.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2025 12:17 AM - edited ‎03-25-2025 12:17 AM
Use this script to execute -
javascript: var date = new GlideDateTime(); date.addDaysLocalTime(7); date.getDisplayValue();
Screenshot below working -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2025 12:46 AM
use this
javascript: var myDate; var gdt = new GlideDateTime(); gdt.addDays(7); myDate = gdt.getDate(); myDate;
If my response helped please mark it correct and close the thread so that it benefits future readers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 04:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 11:40 PM - edited ‎03-24-2025 11:42 PM
Hello @Aniket Shukla ,
add below code to your default value field of variable.
javascript: var d = new GlideDateTime(); d.addDaysLocalTime(7); d.getDisplayValue();ex : javascript : var d = new GlideDateTime(); d.addDaysLocalTime(7); d.getDisplayValue();
Note :&colon is colon symbol (:)
Thanks,
Valmik Patil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 11:58 PM
Not working , its showing same date not 7 days ahead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2025 12:17 AM - edited ‎03-25-2025 12:17 AM
Use this script to execute -
javascript: var date = new GlideDateTime(); date.addDaysLocalTime(7); date.getDisplayValue();
Screenshot below working -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 04:07 AM