def duration(
         startTime,
         endTime):
  """
  Returns a formatted string with the duration between endTime and startTime.

  Use time.time() to create startTime and endTime.

  @param startTime: A date before endTime.
  @param endTime: A date after startTime.
  """
  minsec = divmod((endTime - startTime), 60)
  return "%s min %s sec" % (str(int((minsec[0]))), str(int((minsec[1]))))