DateFormat Transform

Hi Team,

I need to Generate the current date in ‘yyyy-mm-dd’ format, I tried below transform but its showing me 8601 FORMATS only, can’t we get the date in this format?

input : 2025-09-02T09:29:40.845224Z

Output : 2025-09-02

{
    "name": "gagan-testtransform-Date",
    "type": "dateFormat",
    "attributes": {
        "input": {
            "type": "dateMath",
            "attributes": {
                "expression": "now",
                "roundUp": false
            }
        },
        "outputFormat": "yyyy-MM-dd"
    }
}

@LearningStar

Try below transform

{
  "attributes": {
    "inputFormat": "ISO8601",
    "outputFormat": "yyyy-MM-dd",
    "input": {
      "attributes": {
        "expression": "now",
        "roundUp": false
      },
      "type": "dateMath"
    }
  },
  "type": "dateFormat",
  "name": "Date Format Transform"
}

try like this

{
“name”: “Test-DateTransform”,
“type”: “dateFormat”,
“attributes”: {
“input”: {
“type”: “dateMath”,
“attributes”: {
“expression”: “now”
}
},
“inputFormat”: “ISO8601”,
“outputFormat”: “yyyy-MM-dd”
}
}

not sure if this reflects what you’re actually trying to do with your transform or if it’s just an example, but just as a heads-up - it’s not best practice to tie an identity attribute to a transform that returns the current date/time. this will then update for every user every time identities are processed, which will cause a lot of annoying clutter in the Access History list.

We are currently implementing this for testing purposes, and later it will be integrated into our account provisioning plan. Before incorporating it into our provisioning policy, I wanted to validate the format with you to ensure everything aligns with best practices.

Thank you in advance for your guidance and suggestions.

1 Like

got it. this would be fine to include in a provisioning plan directly!

Hey , I tried its not working showing me blank output. Shall I put my requirement here again for better understanding ?
I am looking to pass current date of today in my Disable Account policy in this format yyyy-mm-dd format.

Hey @amishra97 , I tried its not working showing me blank output. Shall I put my requirement here again for better understanding ?
I am looking to pass current date of today in my Disable Account policy in this format yyyy-mm-dd format. Can you suggest what should be the best option.

Hey @sjoyee , any help from your side to get the desired output :slight_smile:

Hey Gagan,

The issue with your original transform was a format mismatch between the dateMath output and dateFormat input expectations:dateMath with "expression": "now" outputs in format "yyyy-MM-dd'T'HH:mm". This mismatch caused the blank output

Working Transform:

{
  "name": "Current Date", 
  "type": "dateFormat",
  "attributes": {
    "input": {
      "type": "dateMath",
      "attributes": {
        "expression": "now"
      }
    },
    "inputFormat": "yyyy-MM-dd'T'HH:mm",
    "outputFormat": "yyyy-MM-dd"
  }
}

This will give you the current date in yyyy-MM-dd format for your Disable Account policy.

Hope this helps!

1 Like

You can try the below approach,

Develop a below transform to get the current date with the required format

{
        "name": "Get-TimeStamp",
        "type": "rule",
        "attributes": {
            "name": "Cloud Services Deployment Utility",
            "dateOffset": "",
            "referenceDate": "",
            "inputFormat": "",
            "operation": "getDate",
            "outputFormat": "yyyy-MM-dd"
        },
        "internal": false
    }

Update your Disable policy by referring the above transform. For example, the below AD policy referred the transform in the description AD attribute and given you the output as “Disabled by ISC on 2025-09-09

{
    "name": "Disable",
    "description": null,
    "usageType": "DISABLE",
    "fields": [
        {
            "name": "description",
            "transform": {
                "attributes": {
                    "values": [
                        "Disabled by ISC on ",
                        {
                            "attributes": {
                                "id": "Get-TimeStamp"
                            },
                            "type": "reference"
                        }
                    ]
                },
                "type": "concat"
            },
            "attributes": {
                "cloudRequired": "true"
            },
            "isRequired": false,
            "type": "string",
            "isMultiValued": false
        }
    ]
}

Hope, this helps you.

Hey @LearningStar ,

Try below transform

{ "name": "gagan-testtransform-Date",

"type": "dateFormat",

"attributes": {

    "input": {

        "type": "dateMath",

        "attributes": {

            "expression": "now",

            "roundUp": false

        }

    },

    "inputFormat": "yyyy-MM-dd’T’HH:mm:ss.SSSSSS’Z’",

    "outputFormat": "yyyy-MM-dd"

}
}

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.