- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:34 AM
tmrw is printing as undefined? what might be the reason for this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:53 AM
Hi @KM SN
Try this
var today = new GlideDate();
gs.print(today);
today.addDaysUTC(1);
gs.print(today);
addDaysUTC - Adds a specified number of days to the current object but doesn't return any value, so tmrw is showing as undefined
You can use the same object 'today'
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:54 AM
Most of the handy functions available in GlideDateTime are not in GlideDate. Use GlideDateTime, then you can get just the date from that if you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:53 AM
Hi @KM SN
Try this
var today = new GlideDate();
gs.print(today);
today.addDaysUTC(1);
gs.print(today);
addDaysUTC - Adds a specified number of days to the current object but doesn't return any value, so tmrw is showing as undefined
You can use the same object 'today'
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:55 AM
Docs Link - https://docs.servicenow.com/bundle/xanadu-api-reference/page/app-store/dev_portal/API_reference/Glid...
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 10:54 AM
Most of the handy functions available in GlideDateTime are not in GlideDate. Use GlideDateTime, then you can get just the date from that if you want.