Function rcutils_time_point_value_as_date_string

Function Documentation

rcutils_ret_t rcutils_time_point_value_as_date_string(const rcutils_time_point_value_t *time_point, char *str, size_t str_size)

Return a time point as an datetime in local time with milliseconds in a string.

If the given string is not large enough, the result will be truncated. If you need a string with variable width, using snprintf() directly is recommended.

Attribute

Adherence

Allocates Memory

No [1]

Thread-Safe

Yes

Uses Atomics

No

Lock-Free

Yes

[1] if does not allocate additional memory internally

Parameters:
  • time_point[in] the time to be made into a string

  • str[out] the output string in which it is stored

  • str_size[in] the size of the output string

Returns:

RCUTILS_RET_OK if successful (even if truncated), or

Returns:

RCUTILS_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCUTILS_RET_ERROR if an unspecified error occur.