Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

GlideDateTime.getDisplayValue results are different between Flow Designer and Script Background

Kentaro Numata
Tera Guru

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();

 

スクリーンショット 2024-06-10 11.25.51.png

1 ACCEPTED SOLUTION

@Kentaro Numata 

so are you having custom action in flow which is returning the time?

what's your business requirement?

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

View solution in original post

8 REPLIES 8

Kentaro Numata
Tera Guru

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();

Sanket Landge
Tera Expert

Hello @Kentaro Numata ,

 

Can you try to open this from you personal laptop?

 

Thanks,
Sanket Landge