execution.setVariable(‘myDate’, new Date())
execution.getVariable(‘myDate’) // Output = Tue Nov 30 2021 20:29:15 GMT+0100
But I need a JSON valid date format which I can later deserialize →
for example: “2021-11-30T19:32:42.006Z”
Anyone has a solution, how to get a Date variable with execution.getVariable in a formatted form ?
What have you done to try to format it?
And what’s the impact to you if you convert it before you set it?
execution.setVariable(‘myDate’, new Date().getISOString())
I can’t because the variable is already set in a pre-process. It was just a sample above.
What about doing:
strDate = new Date(execution.getVariable(‘myDate’)).toISOString();
Then use strDate where you want your ISO formatted date string.