code: def proto_ts_from_datetime_str(dt):
      
  
      ts = Timestamp()
      if (dt is not None):
          try:
              ts.FromJsonString(dt)
          except ParseError:
              pass
      return ts
docs: Converts string datetime in ISO format to protobuf timestamp.
      :type dt: str
      :param dt: string with datetime in ISO format
      :rtype: :class:`~google.protobuf.timestamp_pb2.Timestamp`
      :returns: protobuf timestamp