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 - ISO Datetime, Epoch Seconds, Epoch Milliseconds

true

Usage

  1. Specify a variable name where the current datetime will be stored.

  2. Select the desired format type for the datetime

Format Types

The node supports three format types for storing the datetime:

  1. ISO Datetime: Returns the current datetime in ISO 8601 format (e.g., "2024-07-22T10:30:00.000Z")

  2. Epoch Seconds: Returns the current time as Unix timestamp in seconds (e.g., 1721234567)

  3. 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:

  1. Set Variable name to action_timestamp

  2. 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