- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 05:48 AM
Hello All,
We have an integration with 3rd part application where are receiving Dates in ISO8601 format. Does anyone know how to process in within servicenow so that time and timezone would remains same. Below are some of the formats we receive:
1)2020-07-31T11:18:31.114Z
2)2020-07-31T11:18:31.161+0000
3)2020-07-31T06:39:51Z
Thank You
Solved! Go to Solution.
- Labels:
-
IntegrationHub
-
Orchestration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 06:00 AM
Hi Gaurav,
these links should help you
How to convert iso date string (2015-11-18T20:00:00Z) to local time
How to Transform ISO8601 date (yyyy-MM-ddTHH:mm:ssZ) to a date field in a Transform map
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 06:00 AM
Hi Gaurav,
these links should help you
How to convert iso date string (2015-11-18T20:00:00Z) to local time
How to Transform ISO8601 date (yyyy-MM-ddTHH:mm:ssZ) to a date field in a Transform map
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 11:47 PM
Hi Ankur,
I have checked both the links already, first link works somehow but 2nd link doesn't process the all the formats. I was looking if any servicenow API available for processing ISO8601 date format.
Regards
Gaurav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2020 12:44 AM
To sure where the problem is. Following will convert iso8601 to Javascript datetime.
This can be converted to GlideDateTime.
var x = g_form.getValue("isodatetime");
var d = new Date(x);
Below is a simple conversion function to convert ISO8601 to yyyy-MM-dd hh:mm:ss
var MM = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
var xx = x.replace(
/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):\d{2}(\w{3})/,
function($0, $1, $2, $3, $4, $5, $6) {
return $1+"-"+MM[$2-1]+"-"+$3+" "+$4+":"+$5;
}
);