original_docstring: Convert the datetime string to utc datetime string.
docstring: Convert the datetime string to utc datetime string.
docstring_tokens: Convert the datetime string to utc datetime string .
code: def convert_to_utc_datetime(thedate: str) -> str:
      """Convert the datetime string to utc datetime string."""
      try:
          # tries converting two formats before bailing
          try:
              datetime_obj = datetime.datetime.strptime(thedate, '%Y-%m-%dT%H:%M:%S.%f+00:00')
          except Exception:  # pylint: disable=broad-except;
              datetime_obj = datetime.datetime.strptime(thedate, '%Y-%m-%dT%H:%M:%S+00:00')
          datetime_utc = datetime_obj.replace(tzinfo=timezone('UTC'))
          return datetime_utc.strftime('%Y-%m-%dT%H:%M:%S')
      except Exception as err:  # pylint: disable=broad-except; want to return None in all cases where convert failed
          current_app.logger.error(f'Tried to convert {thedate}, but failed: {err}')
          raise err
code_tokens: def convert_to_utc_datetime ( thedate : str ) -> str : try : try : datetime_obj = datetime . datetime . strptime ( thedate , '%Y-%m-%dT%H:%M:%S.%f+00:00' ) except Exception : datetime_obj = datetime . datetime . strptime ( thedate , '%Y-%m-%dT%H:%M:%S+00:00' ) datetime_utc = datetime_obj . replace ( tzinfo = timezone ( 'UTC' ) ) return datetime_utc . strftime ( '%Y-%m-%dT%H:%M:%S' ) except Exception as err : current_app . logger . error ( f'Tried to convert {thedate}, but failed: {err}' ) raise err
short_docstring: Convert the datetime string to utc datetime string.
short_docstring_tokens: Convert the datetime string to utc datetime string .
comment: """Convert the datetime string to utc datetime string."""$SEP$# tries converting two formats before bailing$SEP$# pylint: disable=broad-except;$SEP$# pylint: disable=broad-except; want to return None in all cases where convert failed