Normalize UTC dates
Convert valid timestamps to ISO strings and mark invalid inputs.
Original starter · no credentials · manual execution
The sample transformation is tested against the output below. Import and execution in your specific n8n version still need verification.
When to use it
Normalize already specified timestamps before reporting or exporting.
What is in the workflow?
- Manual Trigger: start a test deliberately.
- Sample data: synthetic rows in a Code node.
- Normalize UTC dates: a Code node with the transformation.
- Read first: a Sticky Note with setup and limitations.
Sample input
[
{
"date": "2028-02-29T10:00:00Z",
"title": "Leap day"
},
{
"date": "not-a-date",
"title": "Review this row"
}
]Expected output
One ISO UTC timestamp and one explicitly invalid row.
[
{
"date": "2028-02-29T10:00:00Z",
"title": "Leap day",
"isoDate": "2028-02-29T10:00:00.000Z",
"validDate": true
},
{
"date": "not-a-date",
"title": "Review this row",
"isoDate": null,
"validDate": false
}
]Import and adapt
- Download the JSON and use Import from File in your n8n editor.
- Review the Code nodes, then execute manually with the included sample.
- Compare the final output to the example above.
- Replace Sample data with your own source only after reviewing the input contract.
Before using real data
Prefer ISO timestamps with an explicit offset. Ambiguous input strings use JavaScript date parsing and may not match local business dates.
This template does not send messages or contact external services. Adding a source or destination changes its behavior; test the complete workflow in your instance.