DATE
Takes a date, represented by a string, an integer, or a DATE_PARSE object, and returns a formatted string representation.
The output format is defined in ruby strftime (Time) syntax.
Optionally, the output timezone can be specified with values from the tz database.
Natural language parsing is handled by chronic. It doesn't understand every phrase, and it misreads some (like "end of the month") instead of rejecting them, so test natural-language input before relying on it, or use DATE_PARSE to define the format explicitly.
Ambiguous dates like "01/02/2023" are read as DD/MM/YYYY. When the input describes a span of time, like "May 2024", DATE uses its start. Input that can't be parsed is returned unchanged.
Categories: Dates/Times
Syntax
Examples
Example 1
Formula
Output
Example 2
Formula
Output
Example 3: Takes DATE_PARSE objects
Formula
Output
Example 4: Many different representations of dates are supported
Formula
Output
Example 5: Natural language dates are supported. See [chronic](https://github.com/mojombo/chronic#examples) for more examples.
Formula
Output
Example 6: Relative times are supported. See [chronic](https://github.com/mojombo/chronic#examples) for more examples.
Formula
Output
Example 7: Unix timestamps are supported
Formula
Output
Example 8: Unix timestamps with 13+ digits are treated as milliseconds
Formula
Output
Example 9: To get the current time, pass the keyword `"now"` (or `"today"`)
Formula
Output
Example 10: Defaults to iso8601 format with three decimal places if no format is provided
Formula
Output
Example 11: Takes optional timezone argument
Formula
Output
Example 12: Ambiguous dates are read as DD/MM/YYYY
Formula
Output
Example 13: When the input describes a span of time, like a month, DATE uses its start
Formula
Output
Example 14: Input that can't be parsed is returned unchanged
Formula
Output
Sample actions
Select an action to inspect
You can also click "Copy actions" and paste them in your Tines story to see how they work.