Date and Time Functions
Last updated: October 21, 2026
| Tier | Deployment |
|
|
|
You can use date and time functions in custom tables and fields. See Adding Custom Tables and Defining and Editing Field Formulas for further details.
For a short video overview of the date and time functions, see below:
Following are descriptions for the date and time functions:
ADDYEARS(datetime, number)
ADDQUARTERS(datetime, number)
ADDMONTHS(datetime, number)
ADDDAYS(datetime, number)
ADDHOURS(datetime, number)
ADDMINUTES(datetime, number)
ADDSECONDS(datetime, number)
Adds a given number of years|quarters|months|days|hours|minutes|seconds to a specified date/time. An example of
when to use this is when the fiscal year is not the same as the Gregorian calendar's beginning and end dates.
CREATEDATE(year,month,day)
Creates a timestamp from a given year, month and day. Time is set to midnight.
CURRENTDATE()
Returns the current date.
CURRENTTIME()
Returns the current time.
CURRENTTIMESTAMP()
Returns the current timestamp.
GETYEAR(datetime)
GETQUARTER(datetime)
GETMONTH(datetime)
GETDAY(datetime)
GETHOUR(datetime)
GETMINUTE(datetime)
GETSECOND(datetime)
Returns a number that represents the year|quarter|month|day|hour|minute|second in a given date/time.
DAYOFWEEK(datetime)
Returns the day, out of seven days in a week, represented by a given date/time.
DAYOFYEAR(datetime)
Returns the day, out of 365 days in a year, represented by a given date/time.
WEEKOFYEAR(datetime)
Returns the week, out of 52 weeks in a year, represented by a given date/time.
Note:
The WEEKOFYEAR function does not take into consideration the setting for First Day of Week. It always assumes that the week starts on Monday.
DAYNAME(number)
Returns the name of the day represented by the given number.
YEARDIFF(end,start)
QUARTERDIFF(end,start)
MONTHDIFF(end,start)
DAYDIFF(end,start)
HOURDIFF(end,start)
MINUTEDIFF(end,start)
SECONDDIFF(end,start)
Returns the difference in years|quarters|months|days|hours|minutes|seconds
TODATETIME()
Converts a specified value to a DateTime value. Sisense supports the string format: YYYY-MM-DD HH:mm:ss:ms and
YYYY-MM-DD HH:mm:ss. If not HH:mm:ss are entered, Sisense assumes that the time is 12:00AM.
As of version 2026.4.1, TODATETIME is also supported in Calculated Dimensions, where it is evaluated when the widget runs.
Note:
As of version 2026.4.1, custom columns that use TODATETIME use the same conversion when they are built to a cloud data warehouse (Build to Destination):
-
PostgreSQL and Redshift: The result keeps the time part of the value. Previously, only the date was kept and the time was set to midnight. Reports that group by day are not affected, but reports that compare exact date and time values may change after the next build.
-
Azure Synapse and Microsoft Fabric: Custom columns that use TODATETIME now build successfully. Previously, the build failed.
-
ElastiCube: Invalid text shows a clear error message instead of a database error.