Flow Designer script action date handling issue

Erik Gunther2
Kilo Guru

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).

find_real_file.png

find_real_file.png

And finally, I ran some background scripts to see if I had a time zone discrepancy, which I don't think I do.

find_real_file.png

find_real_file.png

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.

 

6 REPLIES 6

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.

Hi Erik,

can you mark answer as correct, 👍 helpful & close the thread. Thanks in advance

Regards

Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader