Date and Time Functions

You can use date and time functions in custom tables and fields. See Adding a Custom Table and Editing Field Formulas for further details.

For a short video overview of the date and time functions, see below:

Below are explanations of the available 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.

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.

.r.