def FormatDatetime(date, day_only=False):
  """Returns a string representing the given UTC datetime."""
  if not date:
    return None
  if day_only:
    return date.strftime('%Y-%m-%d')
  return date.strftime('%Y-%m-%d %H:%M:%S UTC')