GlideSystem - calDateDiff(String startDate, String endDate, Boolean numericValue)

Calculate the difference between two dates using the default calendar.

Calendars are now legacy. If Schedules are being used, see the topic Calculate Duration Given a Schedule.

Table 1. Parameters
Name Type Description
startDate String The starting date to compare in the current user's date format.
endDate String The ending date to compare in the current user's date format.
numericValue Boolean If true, the return value will be formatted in number of seconds; if false the return value will be formatted ddd hh:mm:ss.
Table 2. Returns
Type Description
String If the numericValue parameter is true, returns the difference between the two dates as an integer number of seconds; if false, returns the difference between the two dates in the format ddd hh:mm:ss.