Date Functions
Date functions accept date and datetime inputs as variables or string literals.
Supported formats are date values (YYYY-MM-DD) and datetime values (YYYY-MM-DD HH:mm:ss).
Datetime extraction and boundary operations use the workflow timezone. Date-only values are timezone agnostic.
| Function | Description | Examples |
|---|---|---|
| TODAY | Current date in the workflow timezone | TODAY() -> 2026-03-04 |
| NOW | Current date and time in the workflow timezone | NOW() -> 2026-03-04 06:07:53 |
| DATE | Create a date from year, month, and day | DATE(2026, 7, 12) → 2026-07-12 |
| YEAR | Extract year from date or datetime | YEAR("2017-11-07") → 2017 |
| MONTH | Extract month (1-12) from date or datetime | MONTH("1996-02-18") → 2 |
| DAY | Extract day of month (1-31) from date or datetime | DAY("1985-06-30 14:22:10") → 30 DAY("2024-02-18") → 18 |
| WEEKDAY | Weekday number (Sunday = 1, Saturday = 7). | WEEKDAY("2026-03-04") -> 4 WEEKDAY("2026-03-04", "1") -> 4 WEEKDAY("2026-03-04", "2") -> 3 WEEKDAY("2026-03-04", "3") -> 2 |
Optional second argument controls numbering:
| ||
| DATE_ADD | Add a number of units to a date or datetime | DATE_ADD("2021-01-15", 30, "days") → 2021-02-14 DATE_ADD("2012-07-10 09:30:00", 2, "hours") → 2012-07-10 11:30:00 DATE_ADD("1999-12-21", 11, "days") → 2000-01-01 |
Unit options:
| ||
| DATE_DIFF | Difference between two dates in whole units ( | DATE_DIFF("2028-02-15", "2028-02-18", "days") → -3 DATE_DIFF("2008-02-18", "2008-02-15", "days") → 3 DATE_DIFF("1990-03-01", "1990-02-18", "days") → 11 |
Unit options:
| ||
| START_OF | Start of a unit | START_OF("2023-02-18", "month") → 2023-02-01 START_OF("2018-11-09 16:45:20", "day") → 2018-11-09 00:00:00 |
Unit options:
| ||
| END_OF | End of a unit | END_OF("2024-02-18", "month") → 2024-02-29 END_OF("1983-11-09 16:45:20", "day") → 1983-11-09 23:59:59 |
Unit options:
| ||
| FORMAT_DATE | Format date or datetime text using pattern tokens | FORMAT_DATE("2026-02-18", "DD/MM/YYYY") → "18/02/2026" FORMAT_DATE("2014-11-07", "YYYY-MM-DD") → "2014-11-07" FORMAT_DATE("2005-03-14 16:05:09", "MM-DD-YY HH:mm:ss") → "03-14-05 16:05:09" FORMAT_DATE("2022-03-14 16:05:09", "M/D/YYYY h:m:s A") → "3/14/2022 4:5:9 PM" FORMAT_DATE("1991-09-01", "DD/MM/YYYY") → "01/09/1991" |
Supported tokens:
| ||