Calculate the Time Between Two Dates
Use date_diff() and daysBetween() to calculate the time between two dates.
Use now() to get the current time. You can use these functions with DateTime, DateOnly, or Date types.
-
date_diff(datepart, startdate, enddate)
Returns an integer representing the interval that has elapsed between two dates.
-
Returns the number of days between two dates as an integer.
-
Returns current datetime in the specified time zone. This function is valid only in a
foreachstatement.