Difference

Calculate the difference in time between two dates.

Input

Field Definition Type Required
end date Later date and time against which an earlier date (start date) is compared. Date & Time TRUE
start date Earlier date and time against which a later date (end date) is compared. If the value start date is later, then the output values will be negative, indicating that it is past the value of end date. Date & Time TRUE

Output

All of the outputs express the full amount of time it will take to get to end date from start date in that unit.

For example, if end date is exactly one day after start date, then the output value for days will be 1 and hours will be 24.

Field Definition Type
days Difference in days between the values for end date and start date, including partial days. Number
months Difference in months between the values for end date and start date, including partial months. Number
years Difference in years between the values for end date and start date, including partial years. Number
hours Difference in hours between the values for end date and start date, including partial hours. Number
minutes Difference in minutes between the values for end date and start date, including partial minutes. Number
seconds Difference in seconds between the values for end date and start date. Number
milliseconds Difference in milliseconds between the values for end date and start date. Number

Related topics

Functions in Workflows

About the elements of Okta Workflows