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.

Incorrect Date and Time being returned by getLocalDate and getLocalTime

CraigL
Tera Contributor

Hi all,

 

We have a bit of a peculiar one with dates being passed through to an email from a Change record.

Not on every record, but some are not presenting dates as they should be, to show Start & End times of the change.

 

The Result :

CHG0093359_Wrong_Dates.png

 

The process :

UI Action on Form...Drops Event...Triggers Notification...Mail Template...Mail Script...etc.

 

The Event (parm2 in JSON) has :

CHG0093359_Event_Data.pngThis is expected as we are BST

 

The Mail Script extracts the date, and passes it to a function to get the Local Date and Time, which should change this back to 01:00 & 06:00 as it does with many other emails. However some are returning incorrect dates as shown above.

 

I know this looks very like a PDT issue with the 8 hour gap but we have checked the "Users\System" time zone and all are set to "Europe\London"

 

Any ideas ? Oh, we have also just upgraded to Washington from Utah.

 

Regards, Craig.

0 REPLIES 0