Skip to content

Add utility function to get datetime.datetime from Time #1269

@tonynajjar

Description

@tonynajjar

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions