DATE

Converts a timestamp into another date format.

Syntax 

DATE(timestamp, format)

Examples 

Example 1

Input

{
  "my_action": {
    "message": "2021-07-17"
  }
}

Formula

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

Output

"Fri, Jul 17, 21"
Example 2

Input

{
  "my_action": {
    "message": "2021-07-17"
  }
}

Formula

DATE(my_action.message, "%Y")

Output

"2021"
Example 3

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

Input

{
  "my_action": {
    "message": 1647712141
  }
}

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

{
  "my_action": {
    "message": "March 17, 2021"
  }
}

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"