> For the complete documentation index, see [llms.txt](https://docs.cosmocloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cosmocloud.io/flow-builder/node-types/variable-nodes/date-and-time/set-current-datetime.md).

# 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       | [Node Name](/flow-builder/node-name.md)                                                                                                                      | true         |
| Variable name   | The name of the variable where the current datetime will be stored                                                                                           | true         |
| Datetime format | <p>The format in which the datetime should be stored<br>Options - <code>ISO Datetime</code>, <code>Epoch Seconds</code>, <code>Epoch Milliseconds</code></p> | 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cosmocloud.io/flow-builder/node-types/variable-nodes/date-and-time/set-current-datetime.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
