Skip to main content



Date Functions

Perform date parsing and math operations.

Date FunctionDescription
AddDaysThe AddDays function adds a specified number of days to a DateTime value.
AddHoursThe AddHours function adds a specified number of hours to a DateTime value.
AddMillisecondsThe AddMilliseconds function adds a specified number of milliseconds to a DateTime value.
AddMinutesThe AddMinutes function adds a specified number of minutes to a DateTime value.
AddMonthsThe AddMonths function adds a specified number of months to a DateTime value.
AddSecondsThe AddSeconds function adds a specified number of seconds to a DateTime value.
AddWeekdaysThe AddWeekdays function adds a specified number of weekdays to a DateTime value.
AddYearsThe AddYears function adds a specified number of years to a DateTime value.
BuildDateThe BuildDate function returns a date from a specified year, month, and day.
DayReturns the day of the month for a given Date or DateTime.
DayDiffThe DayDiff function returns the number of days between two Date values.
DayOfWeekReturns the day of the week with 0 = Sunday and 6 = Saturday.
DayOfYearReturns the day of the year, 1 = 1/1 and 365(366) = 12/31.
DaysInMonthThe DaysInMonth function returns the number of days in the month.
DaysInYearReturns the number of days in the year.
GetLocalDateTimeReturns a datetime value having Local kind.
GetUnspecifiedDateTimeReturns a datetime value having an Unspecified kind.
GetUtcDateTimeReturns a datetime value having UTC kind.
HourThe Hour function returns the hour of the day for a given DateTime (0 to 23).
HourDiffThe HourDiff function returns the number of hours between two DateTime values.
IsDateThe IsDate function determines if an expression is a valid Date (or a DateTime with a zero time offset).
IsDateTimeThe IsDateTime function determines if an expression is a valid DateTime.
IsLeapYearThe IsLeapYear function returns true if the year is a leap year.
IsLocalDateTimeReturns true if the expression is a valid Local kind datetime.
IsUnspecifiedDateTimeReturns true if the expression is a valid unspecified kind datetime.
IsUtcDateTimeReturns true if the expression is a valid UTC kind datetime.
IsWeekdayThe IsWeekday function returns true if a given DateTime is not a Saturday or Sunday.
IsWeekendReturns true if the given date is a Saturday or Sunday.
MillisecondThe Millisecond function returns the milliseconds for a given DateTime (0 to 999).
MillisecondDiffThe MillisecondDiff function returns the number of milliseconds between two DateTime values.
MinuteThe Minute function returns the minute of the hour for a given DateTime (0 to 59).
MinuteDiffThe MinuteDiff function returns the number of minutes between two DateTime values.
MonthReturns the month for a given Date or DateTime.
MonthDiffThe MonthDiff function returns the number of months between two Date values.
NowThe Now function returns the current date and time in the local time zone, as of the start of rule processing.
SecondThe Second function returns the seconds for a given DateTime (0 to 59).
SecondDiffThe SecondDiff function returns the number of seconds between two DateTime values.
ToDateThe ToDate function converts an expression to a Date value.
ToDateTimeThe ToDateTime function converts an expression to a DateTime value.
TodayReturns the current date as of the start of rule processing.
ToTimeThe ToTime function returns a time based on source parameters. The date portion is 1/2/0001.
WeekdayDiffThe WeekdayDiff function returns the number of weekdays between two Date values.
YearReturns the year for a given Date or DateTime.
YearDiffThe YearDiff function returns the number of years between two Date values.