Date function

This topic provides the Date functions available for an Expression activity.

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

Input type for interval

Returns

Description

AddDays(Date, interval)

Double

Date

Returns a date to which a specified number of days is added.

AddHours(Date, interval)

Double

Date

Returns a date to which a specified number of hours is added.

AddMinutes(Date, interval)

Double

Date

Returns a date to which a specified number of minutes is added.

AddSeconds(Date, interval)

Double

Date

Returns a date to which a specified number of seconds is added.

AddMonths(Date, interval)

Long

Date

Returns a date to which a specified number of months is added.

AddYears(Date, interval)

Long

Date

Returns a date to which a specified number of years is added.

SubtractDays(Date, interval)

Long

Date

Returns a date to which a specified number of days is deducted.

SubtractHours(Date, interval)

Long

Date

Returns a date to which a specified number of hours is deducted.

SubtractMinutes(Date, interval)

Long

Date

Returns a date to which a specified number of minutes is deducted.

SubtractSeconds(Date, interval)

Long

Date

Returns a date to which a specified number of seconds is deducted.

SubtractMonths(Date, interval)

Long

Date

Returns a date to which a specified number of months is deducted.

SubtractYears(Date, interval)

Long

Date

Returns a date to which a specified number of years is deducted.

ToISODateString(date)

String

Returns the date string in ISO date format and UTC time zone.

Day(date)

Number

Returns a number that represents the day of the month (between 1 and 31, inclusive).

Hour(date)

Number

Returns a number that represents the hour of the day (between 0 and 23, inclusive).

Minute(date)

Number

Returns a number that represents the minute of the hour (between 0 and 59, inclusive).

Month(date)

Number

Returns a number that represents the month of the year (between 1 and 12, inclusive).

Second(date)

Number

Returns a number that represents the second of the minute (between 0 and 59, inclusive).

Year(date)

Number

Returns a number that represents the year.

Weekday(date)

Number

Returns a number that represents the day of the week (between 1 and 7, inclusive) where Sunday is 1.

WeekdayName(date)

String

Returns the name of a specified day of the week.

MonthName(date)

String

Returns the name of a specified month.

Now()

Date

Returns the current system date and time.

DaysDifference(date,date)

Number

Returns the number of days between two dates.

FromDateString (string)

Date

Returns the date that is converted from the date string input.

Yesterday()

Date

Returns the date of yesterday.

Tomorrow()

Date

Returns the date of tomorrow.

IsLeapYear(date)

Bool

Returns true or false if the year is a leap year.

MinutesDifference(date, date)

Number

Returns the number of minutes between two datetime values.