Automate Date and Time Retrieval for Your Workflows
detail.loadingPreview
Effortlessly capture accurate local date and time information within your n8n workflows. This powerful tool provides a comprehensive set of date and time components for seamless integration into your automated processes.
About This Workflow
The 'Get Local Datetime' node is designed to inject precise date and time data into your n8n workflows. Triggered manually, it leverages the moment.js library to fetch the current date and time based on your specified timezone (configurable via environment variables). It then breaks down this information into granular components including year, month, day, hour, minute, second, and millisecond. A fully formatted string representation is also provided for easy readability and direct use in various applications. This node ensures that your workflows always have access to the most up-to-date temporal data, vital for scheduling, logging, and time-sensitive operations.
Key Features
- Real-time Date & Time Capture: Get the current date and time instantly upon execution.
- Timezone Aware: Configurable to retrieve datetimes based on your specific timezone settings.
- Granular Data Extraction: Access individual components like year, month, day, hour, minute, second, and millisecond.
- Formatted Output: Receive a pre-formatted date and time string for convenience.
- Easy Integration: Seamlessly fits into any n8n workflow to enhance time-based logic.
How To Use
- Add the 'Get Local Datetime' Node: Drag and drop the 'Function' node onto your n8n canvas.
- Paste the Code: Copy and paste the provided
functionCodeinto the node's editor. - Configure Timezone (Optional but Recommended): Ensure you have an environment variable named
GENERIC_TIMEZONEset with your desired timezone (e.g., 'America/New_York', 'UTC'). - Connect the Trigger: Link your desired trigger node (e.g., 'Manual Trigger' as shown) to the 'Get Local Datetime' node.
- Execute and Observe: Click 'Execute' on your trigger node. The output will contain the detailed date and time information.
Apps Used
Workflow JSON
{
"id": "3a3774b4-6d21-4b9f-a38b-51ebbfea881a",
"name": "Automate Date and Time Retrieval for Your Workflows",
"nodes": 17,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 3a3774b4-6d21...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Universal CSV to JSON API Converter
Effortlessly transform CSV data into structured JSON with this versatile n8n workflow. Integrate it into any application as a custom API endpoint, supporting various input methods including file uploads and raw text.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.