Scripting Help Convert UTC to EST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 09:26 AM
Hi,
I am in a developer instance using the full version of the Performance Analytics plugin for ServiceNow. I'm trying to edit the script for this one pre-made automated breakdown called Opened Hour Of Day, which shows the number of incidents that were opened and what hour they were opened on. The reason why I'm trying to edit this script is because while it does what it is supposed to do, the time's the breakdown is organizing it by is in UTC (ServiceNow's internal system time). The code that came already came with the breakdown is listed below:
In case you have a hard time reading the line of code it says: current.opened_at.getByFormat('H');
I would like the code to convert this output from UTC to EST please. Any help I can get would be greatly appreciated!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 09:47 AM
HI Kim,
Check the below link it may help you
How to convert GMT date to EST
how to convert glideDateTime that from GMT to EST using script include
In transform map need to convert UTC to EST time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 09:49 AM
Hello kim
This post might help you.
Convert UTC to Time Zone (US/Eastern) from GlideRecord query output
Please mark my response as correct and helpful if it helped solved your question.
-Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 09:54 AM
I cannot think of any out of box quick methods you can just call and have this work. You are going to have to use a regular expression to do this. So current.opened_at.getDisplayValue() will get the date time in EST then you can use a regular expression to extract the hours.