flowprepRuns in your browser
THE FLOWPREP FIELD GUIDE

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?

  1. Manual Trigger: start a test deliberately.
  2. Sample data: synthetic rows in a Code node.
  3. Normalize UTC dates: a Code node with the transformation.
  4. 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

  1. Download the JSON and use Import from File in your n8n editor.
  2. Review the Code nodes, then execute manually with the included sample.
  3. Compare the final output to the example above.
  4. 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.

References

← All starter workflows