Open tonynajjar opened 2 months ago
This is an excellent idea, as I think it is a common issue when trying to timestamp out things and the management of the seconds/nanoseconds into a correct datetime can be challenging for new users.
It wouldn't be far off something like this SO answer - https://stackoverflow.com/questions/15649942/how-to-convert-epoch-time-with-nanoseconds-to-human-readable - but with the use of rclpy.Time right?
Feature request
Feature description
I found myself needing to convert from rclpy's Time to datetime.datetime to input that in a third-party library. Would it make sense to add such a utility function? If so I could open a PR
Implementation considerations
I think it would just look like that:
return datetime.datetime.fromtimestamp(self._time_handle.nanoseconds / 1e9)