code: def format_datetime(date):
      
      # todo: test me
      if date.utcoffset() is None:
          return date.isoformat() + 'Z'
  
      utc_offset_sec = date.utcoffset()
      utc_date = date - utc_offset_sec
      utc_date_without_offset = utc_date.replace(tzinfo=None)
      return utc_date_without_offset.isoformat() + 'Z'
docs: Convert datetime to UTC ISO 8601