DATE

Converts a timestamp into another date format.

The output format is described in strftime syntax.

Syntax 

DATE(timestamp, format)

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": "2021-07-17"
4
}
5
}

Formula

DATE(my_action.message, "%a, %b %d, %y")

Output

"Fri, Jul 17, 21"

Example 2

Input

1
{
2
"my_action": {
3
"message": "2021-07-17"
4
}
5
}

Formula

DATE(my_action.message, "%Y")

Output

"2021"

Example 3

Unix timestamps are supported, and can be converted to ISO8601 as follows:

Input

1
{
2
"my_action": {
3
"message": 1647712141
4
}
5
}

Formula

DATE(my_action.message, "%Y-%m-%dT%H:%M:%S%z")

Output

"2022-03-19T17:49:01+0000"

Example 4

Many different types of textual representations of dates are supported:

Input

1
{
2
"my_action": {
3
"message": "March 17, 2021"
4
}
5
}

Formula

DATE(my_action.message, "%b %d, %y")

Output

"Mar 17, 21"

Example 5

To get the current time, pass the special word "now" (or "today"):

Formula

DATE("now", "%Y-%m-%d %H:%M")

Output

"2022-03-11 16:24"

Sample Actions 

Event Transform
DATE
Event Transform
My Action

Select an Action to inspect.

You can also click "Copy Actions" and paste them in your Tines Story to see how they work.

Was this helpful?