Skip to main content

Date and Time Representations

Date

The ServiceNow default representation of Date is already ISO 8601 (YYYY-MM-DD) conform.

Date values will be rendered unaltered as:

{
...,
"propertyName": "2024-02-21",
...
}

Date/Time

ServiceNow internally stores Date/Time values as UTC values "The value is stored in the field itself in UTC format (Coordinated Universal Time)" and rendered as "YYYY-MM-DD hh:mm:ss". This format is ambiguous as it does not specify a timezone. squid by arc46 will therefore render Date/Time values in a ISO8601 conform Date/Time format:

{
...,
"propertyName": "2024-02-21T16:38:28Z",
...
}

Duration

ServiceNow internally stores Duration values as ms and renders these as 'd HH:mm:ss' (getDurationValue()) or as '3 Days 12 Hours' (getDisplayValue()). Both representations are ServiceNow specific and do not conform to any generally accepted duration formats. As most consumers of squid by arc46 will be external systems, we render durations in an ISO8601 conform Duration format as P[n]DT[n]H[n]M[n]S.

{
...,
"propertyName": "P5DT12H30M5S",
...
}

Any other format including weeks, months or years would be ambiguous. Strictly speaking even our chosen format is ambiguous when taking leap seconds into consideration.

We track. Ok?