def date_diff(taxis, dt1, dt2, units=None):
    """ Returns time interval between two dates. A time axis must be given
  to specify the calendar. If no units are specified the units of the given
  time axis are used."""
    return taxis.date_as_val(dt2, startdate=dt1, units=units)
