Local Time Retrieval Workflow
This workflow is manually triggered to retrieve and output the local time of a specified time zone in real-time, accurate to the millisecond, in the format "YYYY-MM-DD HH:mm:ss.SSS Z". It utilizes the moment.js library for time zone conversion, ensuring the accuracy of time data and addressing the issues of time retrieval and formatting in cross-time-zone environments. It is suitable for automated processes that require accurate timestamps, system log annotations, task scheduling, and data synchronization, thereby enhancing the reliability of time management.

Workflow Name
Local Time Retrieval Workflow
Key Features and Highlights
This workflow is manually triggered to fetch and output the local time of a specified timezone in real-time, accurate to the millisecond. The time format used is “YYYY-MM-DD HH:mm:ss.SSS Z”. It leverages the moment.js library for timezone conversion, ensuring the time data is precise and reliable.
Core Problem Addressed
Accurately obtaining and formatting local time across single or multiple timezones is a common requirement. This workflow resolves the challenge of unified time retrieval and formatting in diverse environments, preventing errors in time calculation and inconsistencies in formatting.
Use Cases
- Scenarios requiring insertion of accurate timestamps within automated processes
- Cross-timezone system log time tagging
- Time recording during task scheduling and event triggering
- Time validation during data synchronization
Main Workflow Steps
- Manual Trigger Execution: The workflow is initiated by user click.
- Local Time Retrieval: A JavaScript function executes, calling moment.js to get the current timezone time as configured in the environment.
- Formatted Output: The time is decomposed into year, month, day, hour, minute, second, and millisecond, then output as a standardized formatted string.
Involved Systems or Services
- n8n automation platform (including Manual Trigger and Function nodes)
- moment.js time handling library (embedded within the Function node)
Target Users and Value
Ideal for automation practitioners, developers, operations engineers, and data analysts who require precise time control and recording. It helps them easily obtain standardized local time data, providing essential support for subsequent time management and data accuracy in workflows.