ManualTrigger Automate

For platform ManualTrigger Automate, this workflow allows users to manually trigger an automated process that retrieves the current local date and time, formatted for easy readability. It provides essential time details, including year, month, day, hour, minute, second, and millisecond, helping users efficiently manage time-sensitive tasks.

7/8/2025
2 nodes
Medium
manualmediumcodecustom
Categories:
Manual TriggeredMedium Workflow

Target Audience

  • Developers: Those who need to automate tasks based on local datetime.
    - Data Analysts: Users who require precise timestamps for data collection and reporting.
    - Project Managers: Individuals looking to track project timelines and deadlines effectively.
    - Business Owners: Entrepreneurs who want to streamline operations and improve efficiency with automated workflows.
  • Problem Solved

    This workflow addresses the challenge of obtaining the current local datetime in a specific timezone. It provides an automated solution to retrieve essential date and time information without manual input, ensuring accuracy and saving time.

    Workflow Steps

  • Step 1: The workflow is initiated by a manual trigger when the user clicks the 'execute' button.
    - Step 2: Upon execution, the workflow proceeds to the Function Node where it utilizes the moment.js library to get the current date and time.
    - Step 3: The function retrieves various components of the datetime, including:
    - Year
    - Month (zero-indexed)
    - Day
    - Hour
    - Minute
    - Second
    - Millisecond
    - Formatted String (e.g., YYYY-MM-DD HH:mm:ss.SSS Z)
    - Step 4: The results are returned in JSON format, providing a structured output for further processing or logging.
  • Customization Guide

  • Users can modify the timezone by changing the value of $env['GENERIC_TIMEZONE'] to fit their needs.
    - The formatting of the output can be adjusted by changing the string in the date.format() method to any valid moment.js format string.
    - Additional date calculations can be added within the function code to perform operations such as adding or subtracting time.
    - Users can expand the workflow by adding more nodes to process the datetime information further, such as sending it to a database or triggering notifications.
  • ManualTrigger Automate - N8N Workflow Directory