Flow Designer script action date handling issue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 11:38 PM
I don't understand how Flow Designer processes dates and times. I created a simple Script Action to test inputs and outputs. The first screenshot shows the script action. It's a very simple pass through of the date/time value as a date/time and as a string. The second screenshot shows that whatever date/time value you pass in as the date_time parameter, you get a date/time value that is shifted by several hours (or more depending on the various methods I've tried).
And finally, I ran some background scripts to see if I had a time zone discrepancy, which I don't think I do.
Please explain why the date shifts in the Script Action. And more importantly, what approach do I use so that I can copy the value without changing the time?
Thanks.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2019 07:20 PM
The update is that ServiceNow is using the time zone of the System User since I configured the Flow to run under that identity not the requesting user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2019 03:37 AM
Hi Erik,
can you mark answer as ✅ correct, 👍 helpful & close the thread. Thanks in advance
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader