Date Functions
Date functions allow you to format, parse, and work with date values.
DATE(D, F)
Formats date D using format string F.
Supported format tokens include: y, M, d, H, m, s.
DATE( TODAY(), "HH:mm:ss yyyy-MM-dd" )
TO_DATE(A, F)
Parses text A into a date using format F.
Supported format tokens include: y, M, d, H, m, s.
TO_DATE( documentDate, "yyyy-MM-dd" )
DAYS(D)
Converts a number of days D into a date value.
Often used for date arithmetic.
DAYS(3)
TODAY() + DAYS( 30 )
DAYS_BETWEEN(A, B)
Returns the number of days between dates A and B.
DAYS_BETWEEN( periodStart, periodEnd )
WORKDAYS_BETWEEN(A, B)
Returns the number of working days between dates A and B.
WORKDAYS_BETWEEN( firstDate, lastDate )
TODAY()
Returns the current date.
TODAY()
MONTH(D)
Returns the month (1–12) from date D.
MONTH( date )
YEAR(D)
Returns the year from date D.
YEAR( date )
MIDNIGHT(D)
Returns date D with time set to midnight.
MIDNIGHT( date )
SAME_DAY(A, B)
Returns true if dates A and B represent the same calendar day (ignores time).
SAME_DAY( fromDate, toDate )
SAME_WEEK(A, B)
Returns true if dates A and B are in the same week.
SAME_WEEK( fromDate, toDate )
CALENDAR_DAYS(Y, M)
Generates an array of date values for year Y and month M.
Month values are in range 1–12.
CALENDAR_DAYS( 2024, 1 )