- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 07:31 PM
Hi, It's Kentaro.
I found that GlideDateTime.getDisplayValue gives different results between Flow Designer and Script Background.
Our time zone is Japan.
The script running the attached image is the same.
I need help because I don't know the cause.
var gdt = new GlideDateTime();
var local = gdt.getValue();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:53 PM
so are you having custom action in flow which is returning the time?
what's your business requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 08:43 PM
getValue() will give GMT time
flow is running with system user?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:29 PM
Hello, @Ankur Bawiskar.
Thank you fore replying.
>getValue() will give GMT time
There was a mistake.
The attached photo is the result of getDisplayValue().(Local time is JST)
var gdt = new GlideDateTime();
var local = gdt.getValue();
↓
var gdt = new GlideDateTime();
var local = gdt.getDisplayValue();
>flow is running with system user?
Yes, I am running as System User.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 11:53 PM
so are you having custom action in flow which is returning the time?
what's your business requirement?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 12:29 AM
Hello @Ankur Bawiskar.
Yes, you're right.
I would like to create a batch process using Flow Designer that only runs on weekdays.
Flow Designer retrieves incorrect values.
I can get the correct values when I run the same Script in Script Background.
Thanks,
Kentaro.