# Using Date and Time Tokens

## About the Field Type

In Sprinthub, you can work with several date and time related tokens. By default, date values are stored in the **ISO**, always in the **UTC** — for example: `2024-10-11T16:12:47.750Z`. However, it is possible to **format these dates** or even generate **relative dates**, as we will see throughout this article.

In addition, the platform allows you to create **custom fields** of **Date and Time** or just **Date**, offering flexibility to adapt to your process needs, as shown in the example below:

<figure><img src="/files/8a64b30b532b6512ca5d59be09b4a65cc19e2894" alt=""><figcaption><p><em>'Trial Class' field in the fields listing.</em></p></figcaption></figure>

<figure><img src="/files/02d16611a56e2ae37072ba769eaec41686c44a61" alt=""><figcaption><p><em>'Trial Class' field in the lead's full data.</em></p></figcaption></figure>

## Formatting Lead Fields

To format a field of type **Date and Time**, you can use different token options:

* **\[date]** → displays only day, month and year in the Brazilian format.
* **\[datetime]** → works like the `[date]`, but also includes the time.
* **\[yyyy-mm-dd]** → keeps the international standard (ISO 8601).
* **\[yyyy-dd-mm]** → swaps the order of day and month in the year-first pattern.&#x20;
* **\[unix]** → converts the date to the *Unix Timestamp* (total seconds since 01/01/1970), ideal for integrations via API or databases.
* **\[month]** → extracts only the month number (01 to 12).
* **\[year]** → extracts only the four-digit year.
* **\[day]** → extracts only the day of the month.
* **\[time]** → displays only the time (hours and minutes), ignoring the date.

The value inside brackets must be placed **before the token alias** at the time of substitution.\
For example:

```
{contactfield=[date]aula_experimental}
```

Below is a practical example showing how this token is replaced in each of the formats:

<figure><img src="/files/0852b699f2e9eafc20bdbf6a40efcabdc317374a" alt=""><figcaption><p><em>Tokens used in a SAC360 service interaction.</em></p></figcaption></figure>

## Date Functions

In some cases, it can be useful to generate relative dates in real time, for example, get the **current date** at the moment an automation is executed, calculate **the next day** or even **a week ahead**.

This is done through the **tokens** **`function`**.

* To the **right of the equal sign** is the **time reference** (e.g.: `yesterday`, `tomorrow`).
* The **formatting** (optional) can be placed in the **middle of the token**.

#### Common examples:

* One year ago → `{function=lastYear}`
* Last month → `{function=lastMonth}`
* Yesterday → `{function=yesterday}`
* Last week → `{function=lastWeek}`
* Today → `{function=today}`
* It also works for `nextYear`, `nextMonth`, `tomorrow`, etc.

#### Example with formatting, being executed on 09/27/2025:

```
{function=[date]tomorrow} -> 09/28/2025
```

These tokens can be used in different parts of Sprinthub, such as in customer interactions, message sending automations or even in Webhook integrations to external platforms.


---

# Agent Instructions: 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:

```
GET https://docs.sprinthub.com/en/strategies/tokens/using-date-and-time-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
