Set current datetime
Set current datetime node is designed to capture and store the current date and time in a specified format. This node is particularly useful when you need to timestamp events, record the exact time of an operation, or work with time-based data in your workflow.
Properties Panel
Field | Description | Required |
Node name | true | |
Variable name | The name of the variable where the current datetime will be stored | true |
Datetime format | The format in which the datetime should be stored
Options - | true |
Usage
Specify a variable name where the current datetime will be stored.
Select the desired format type for the datetime
Format Types
The node supports three format types for storing the datetime:
ISO Datetime
: Returns the current datetime in ISO 8601 format (e.g., "2024-07-22T10:30:00.000Z")Epoch Seconds
: Returns the current time as Unix timestamp in seconds (e.g., 1721234567)Epoch Milliseconds
: Returns the current time as Unix timestamp in milliseconds (e.g., 1721234567000)
Returns
The node stores the current datetime in the specified variable. You can access this using Magical Autocomplete (e.g., $.variables.<variable_name>
) in any node below this node.
Example
Let's say you want to record the exact time a user action was performed:
Set Variable name to
action_timestamp
Set Format type to
ISO Datetime
This will store the current datetime in ISO format in the variable action_timestamp
. You can then use this timestamp in subsequent nodes.
Best Practices
Be aware of timezone implications when using
ISO Datetime
. The timestamp is generated in the server's local timezone.
Last updated