# Date Math Transform ISO8601 Format Error

**URL:** <https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036>\
**Category:** SHF Discussion and Questions\
**Created:** [November 11, 2021, 7:01am UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036 "2021-11-11T07:01:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethompson](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ethompson/32/17298_2.png) [@ethompson](https://developer.sailpoint.com/discuss/u/ethompson)\
**Post date:** [November 11, 2021, 7:01am UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036/1 "2021-11-11T07:01:40Z")

</div>

We have a start date in format yyyy-MM-dd and that is being converted to ISO8601. This is being populated as expected.

Transform:

{

```
"attributes": {

    "inputFormat": "yyyy-MM-dd",

    "outputFormat": "ISO8601"

},

"id": "Date Format",

"type": "dateFormat"

```

}

![image](https://global.discourse-cdn.com/sailpoint/original/1X/84195a455fa7b34aa349e93b712e4eaf7c024ac3.png)

To calculate an end date, we want to add 1 year.

Transform:

{

```
"attributes": {

    "expression": "+1y",

    "input": {

        "attributes": {

            "input": {

                "attributes": {

                    "attributeName": "start_date",

                    "sourceName": "Source Name"

                },

                "type": "accountAttribute"

            },

            "inputFormat": "yyyy-MM-dd",

            "outputFormat": "ISO8601"

        },

        "type": "dateFormat"

    },

    "roundUp": true

},

"type": "dateMath",

"name": "End Date"

```

}

However, this is being populated in the format  
yyyy-mm-ddT00:00Z

rather than  
yyyy-mm-ddT00:00:00.000Z

![image](https://global.discourse-cdn.com/sailpoint/original/1X/816f759ba853318fe2addd0c437b6ab9c21e9b05.png)

This is causing issues downstream when this value is being parsed as it is not recognized as valid ISO8601.

---

<div class="post-metadata">

**Author:** ![lisa\_ivy](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lisa\_ivy](https://developer.sailpoint.com/discuss/u/lisa_ivy)\
**Post date:** [November 11, 2021, 10:37am UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036/2 "2021-11-11T10:37:10Z")

</div>

Hi Edward,

You’re seeing this format for end date because the output of dateMath transform is not formatted as ISO8601 — it formats date as yyyy-MM-dd’T’HH:mm … You’ll need to put that entire transform as input in a dateFormat transform to convert it to ISO8601. FYI - the dateMath Compass article mentions the required input format for date (ISO8601) and how it formats the output (yyyy-MM-dd’T’HH:mm).

Thanks,  
Lisa Ivy

---

<div class="post-metadata">

**Author:** ![ethompson](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ethompson/32/17298_2.png) [@ethompson](https://developer.sailpoint.com/discuss/u/ethompson)\
**Post date:** [November 11, 2021, 2:39pm UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036/3 "2021-11-11T14:39:39Z")

</div>

@lisa_ivy Thanks, I see that now. Is there a reason that it converts to that format rather than keeping it in ISO8601? Is there a name for that format?

---

<div class="post-metadata">

**Author:** ![lisa\_ivy](https://avatars.discourse-cdn.com/v4/letter/l/ee7513/32.png) [@lisa\_ivy](https://developer.sailpoint.com/discuss/u/lisa_ivy)\
**Post date:** [November 11, 2021, 3:29pm UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036/4 "2021-11-11T15:29:16Z")

</div>

Sorry, I don’t know the reasoning on why the transform has the output in that format, rather than ISO8601. I don’t think that format has a formal name.

Here’s the new transform. Note that you’ll have to delete the old transform and create a new one (if you want to use the same name) because if you try to PUT and replace the existing transform, you’ll receive an error because it has a different transform type (as the outmost operation).

```auto
{
  "attributes": {
      "input": {
        "attributes": {
          "expression": "+1y",
          "input": {
              "attributes": {
                  "input": {
                      "attributes": {
                          "attributeName": "start_date",
                          "sourceName": "Source Name"
                      },
                      "type": "accountAttribute"
                  },
                  "inputFormat": "yyyy-MM-dd",
                  "outputFormat": "ISO8601"
              },
              "type": "dateFormat"
          },
          "roundUp": true
      },
      "type": "dateMath"
      },
      "inputFormat": "yyyy-MM-dd'T'HH:mm",
      "outputFormat": "ISO8601"
  },
  "type": "dateFormat",
  "name": "End Date"
}

```

Thanks,  
Lisa Ivy

---

<div class="post-metadata">

**Author:** ![ethompson](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/ethompson/32/17298_2.png) [@ethompson](https://developer.sailpoint.com/discuss/u/ethompson)\
**Post date:** [November 11, 2021, 3:31pm UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036/5 "2021-11-11T15:31:27Z")

</div>

Thanks @lisa_ivy, I have made those changes and this has resolved our issue.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:22pm UTC](https://developer.sailpoint.com/discuss/t/date-math-transform-iso8601-format-error/2036/6 "2023-07-19T14:22:15Z")

</div>

Closed on July 19, 2023, 2:22pm UTC


