AcademyWorkflowsDevelopment

Get local datetime into Function node using moment.js

  • Recommendedour rating
  • 1,724views on n8n
Open on n8n.io ↗

Paste it straight onto an n8n canvas with Ctrl+V or Cmd+V.

get-local-datetime-into-function-node-using-moment-js.json

Loading the file...

AI automation

Want this workflow running in your company?

A template is the start. We adapt automations like this to your tools, handle the exceptions, and test and monitor them so they hold up under real load.

  • Free 20-minute call to look at your process
  • Connected to the tools you already use
  • Tested, monitored and documented

We have not written a full description for this item yet. The text below comes from its authors.

A quick example showing how to get the local date and time into a Function node using moment.js. This relies on the GENERIC_TIMEZONE environment variable being correctly configured (see the docs here) NOTE: In order for this to work, you must whitelist the moment library for use by setting the following environment variable: NODE_FUNCTION_ALLOW_EXTERNAL=moment For convenience, the Function code i