Try this:
int(decimal-date-time(${date1}) - decimal-date-time(${date2}))
See decimal-date-time() and int() for details.