Date functions

Date functions are essential in scenarios involving time-sensitive decisions or schedules. For example, find the difference between two dates, that is, determine how long a customer has been with the company.

Few functions might throw an "Out of range" error for very huge interval values, even if they are of valid type (that is Double or Long).

At runtime, the function parameter value set in TotalAgility is converted to the relevant input type as mentioned in the Input type for the interval column in the table. If the conversion is from a larger data type to a smaller data type, there might be some loss of data.

Function

Returns

Description

AddDays(Date, interval)

Date

Adds specified days to a date.

AddHours(Date, interval)

Date

Adds specified hours to a date.

AddMinutes(Date, interval)

Date

Adds specified minutes to a date.

AddSeconds(Date, interval)

Date

Adds specified seconds to a date.

AddMonths(Date, interval)

Date

Adds specified months to a date.

AddYears(Date, interval)

Date

Adds specified years to a date.

SubtractDays(Date, interval)

Date

Subtracts specified days from a date.

SubtractHours(Date, interval)

Date

Subtracts specified hours from a date.

SubtractMinutes(Date, interval)

Date

Subtracts specified minutes from a date.

SubtractSeconds(Date, interval)

Date

Subtracts specified seconds from a date.

SubtractMonths(Date, interval)

Date

Subtracts specified months from a date.

SubtractYears(Date, interval)

Date

Subtracts specified years from a date.

ToISODateString(date)

String

Converts a date to ISO format string.

Day(date)

Number

Extracts the day component from a date .

Hour(date)

Number

Extracts the hour component from a date.

Minute(date)

Number

Extracts the minute component from a date.

Month(date)

Number

Extracts the month component from a date.

Second(date)

Number

Extracts the second component from a date.

Year(date)

Number

Extracts the year component from a date.

Weekday(date)

Number

Returns the day of the week as a number.

WeekdayName(date)

String

Returns the name of the weekday.

MonthName(date)

String

Returns the name of the month.

Now()

Date

Returns the current date and time.

DaysDifference(date,date)

Number

Calculates the difference between dates in days.

FromDateString (string)

Date

Converts a string to a date value.

Yesterday()

Date

Returns yesterday's date.

Tomorrow()

Date

Returns tomorrow's date.

IsLeapYear(date)

Bool

Returns true if the year is a leap year.

MinutesDifference(date, date)

Number

Calculates the difference between dates in minutes.