Get Local Datetime in n8n Function Node with Moment.js - n8n Workflow | Neura Market
Get Local Datetime in n8n Function Node with Moment.js
Simple workflow to fetch local date/time components in a Function node using moment.js and GENERIC_TIMEZONE env var. Ideal for developers needing timezone-aware timestamps.
This workflow provides a straightforward example of retrieving the local date and time within an n8n Function node using the moment.js library. It starts with a Manual Trigger node and connects to a Function node that requires moment.js (whitelisted via NODE_FUNCTION_ALLOW_EXTERNAL=moment environment variable) and uses the GENERIC_TIMEZONE env var to get accurate local time.
The Function code parses the current moment in the specified timezone, extracting year, month (zero-indexed), day, hour,
Platform
n8n
Category
Productivity
Price
$4.99
Creator
Jordi Faber
n8n
function node
moment.js
datetime
local time
timezone
development
productivity
timestamp
How to import this workflow into n8n
1Purchase or download the workflow to get the n8n workflow JSON file.
2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
3Open each node marked with a credential warning and connect your own accounts and API keys.
4Run the workflow once manually to verify the data flow, then toggle it to Active.