- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 11:48 AM
I have a Due Date field on my catalog form, named csc_due_date. In the workflow on the Create Task activity, I'm using the due date on the task ticket. I'm using this script:
task.due_date = current.variable_pool.csc_due_date;
The due date field gets updated, but it's off by a day. For example, if I pick 1/15/2022 as my due date on the form, the ticket gets a due date of 1/14/2022.
I don't understand why I'm off by a day. Any help appreciated.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 09:21 PM
Hi,
possibly because of timezone
use this
task.due_date = new GlideDateTime(current.variable_pool.csc_due_date);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 09:21 PM
Hi,
possibly because of timezone
use this
task.due_date = new GlideDateTime(current.variable_pool.csc_due_date);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2022 01:37 PM
Thanks
Am I using GlideDateTime incorrectly or is it not possible to use it in a workflow script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2022 09:14 PM
Hi,
try to debug by adding log statements
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2023 03:06 AM
Hi Ankur,
Could you advise where this script needs to be used in order to achieve the outcome. I am facing similar issue and looking to implement your suggestion.
Regards,
Naresh