Skip to main content
Skip table of contents

Date and Date/Time Functions

Use date and date/time functions in formulas for calculating or translating information into a different format for display in forms and reports. In standard reporting, these functions are helpful in displaying values in columns in a format other than the default. 

FunctionDescription
AddDays(numdays, datetime)This function returns a date or time equal to the specified date with the specified number of days added.
AddDaysInSession(numdaysdatetimelocation)This function returns a date or time equal to the specified date or time plus the specified number of in-session days, using the specified location's track (calendar configuration). If the location parameter is EMPTY, the system-wide track is used. Essentially, this function skips past any days not in session (like weekends, holidays, etc.) to arrive at the final date.
AddDaysInSessionForTrack(numdaysdatetimetrack

This function returns a date or time equal to the specified date or time plus the specified number of in-session days, using the specified track (calendar configuration). If the track parameter is EMPTY, the system-wide track is used. Essentially, this function skips past any days not in session (like weekends, holidays, etc.) to arrive at the final date.

For example, adding one to a Friday date would result in Monday (assuming Monday is in session).

AddHours(numhours, datetimeThis function returns a date or time equal to the specified date or time plus the specified number of hours.
AddMinutes(numminutes, datetimeThis function returns a date or time equal to the specified date or time plus the specified number of minutes.
AddYears(numyears, datetime)This function returns a date or time equal to the specified date or time plus the specified number of years.
AddMonths(nummonths, datetime)

This function returns a date or time equal to the specified date or time plus the specified number of months.

For example, if the result goes past the last day of the month (like February), this function returns the last day of the month.

CurrentDate() This function returns the current date.
CurrentDateTime()This function returns the current date or time.
Date(datetime)This function returns the date portion (with no time) of the date/time value.
DayDifference(earlierdatelaterdate)This function returns the number of days between the two dates.
DayDifferenceInSession(earlierdatelaterdate, location)

This function returns the number of in-session days between the two specified dates, using the specified location's track (calendar configuration). If the location parameter is EMPTY, the system-wide track is used. Essentially, this function skips any days not in session (like weekends, holidays, etc.) to arrive at the final number.

For example, the difference between Friday and the Monday after is one (assuming Monday is in session).

DayDifferenceInSessionForTrack(earlierdatelaterdate, track)

This function returns the number of in-session days between the two specified dates, using the specified track (calendar configuration). If the track parameter is EMPTY, the system-wide track is used. Essentially, this function skips any days not in session (like weekends, holidays, etc.) to arrive at the final number.

For example, the difference between Friday and the Monday after is one (assuming Monday is in session).

DateDay(datetime)This function returns the numeric day (1-31) extracted from the specified date.
DateInSession(datetimelocation

This function returns (true or false) whether the specified date or time is in session, using the specified location's track (calendar configuration). If the location parameter is empty, the system-wide track is used. This function skips any days that are not in session, like weekends or holidays, to arrive at the final number.

For example, the difference between Friday and the Monday after is one (assuming Monday is in session).

DateInSessionForTrack(datetime, track)

This function returns (true or false) whether the specified date or time is "in session," using the specified track (calendar configuration). If the track parameter is EMPTY, the system-wide track is used. Essentially, this function skips any days not in session (like weekends, holidays, etc.) to arrive at the final number.

For example, the difference between Friday and the Monday after is one (assuming Monday is in session).

DateMonth(datetimeThis function returns the numeric month (1-12) extracted from the specified date.
DateTimeHour(datetime)This function returns the hour as an integer (0-23) from the specified date or time.
DateTimeMinute(datetime)This function returns the minute as an integer (0-59) from the specified date or time.
DateWeekDay(datetime)This function returns the day of the week as an integer (1-7, Sun-Sat) from the specified date or time.
DateYear(date)This function returns the four-digit numeric year extracted from the specified date.
HistoryYearReturns the current school year as a school year value.
FormatDate(date, 'format')Formats the specified date into a string with the specified format, which can be one of the following: 'yy.mm.dd', 'yyyy.mm.dd', 'yymmdd', 'yyyymmdd', 'yy/mm/dd', 'yyyy/mm/dd', 'mm-dd-yy', 'mm-dd-yyyy', 'mm/dd/yy', 'dd/mm/yyyy', 'dd/mm/yy', 'dd/mm/yyyy'.
HourDifference(earlierdatetimelaterdatetime)This function returns the number of complete hours between the two dates.
MinuteDifference(earlierdatetimelaterdatetimeThis function returns the number of complete minutes between the two dates.
MonthName(date)This function returns the month's name (like January) on the specified date.
YearDifference(earlierdatetimelaterdatetime)

This function returns the number of full years between the two dates.

For example, YearDifference(BirthDate, CurrentDate()) computes an age.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.