def FormatTimedelta(delta):
  """Returns a string representing the given time delta."""
  if delta is None:
    return None
  hours, remainder = divmod(delta.total_seconds(), 3600)
  minutes, seconds = divmod(remainder, 60)
  return '%02d:%02d:%02d' % (hours, minutes, seconds)