def encode(self, rosMsg):
        """ Transform the rospy.rostime.Time instance to a string of the form
            'YYYY-MM-DDTHH:MM:SS.mmmmmm' (ISO 8601).
        """
        try:
            dt = datetime.fromtimestamp(rosMsg.to_sec())
        except __HOLE__:
            raise TypeError('Received object is not a Time instance.')

        return (dt.isoformat(), {})


# Check custom time classes whether the interface is correctly implemented
dataset/ETHPy150Open rapyuta/rce/rce-core/rce/util/converter.py/_TimeConverter.encode