carb::time::ctime_r

Defined in carb/time/Util.h

template<size_t N>
inline char *carb::time::ctime_r(const time_t *timep, char (&buf)[N]) noexcept

Platform independent version of ctime_r; convert a time_t into a null-terminated string in the user’s local time zone.

Equivalent to:

struct tm tmBuf;
return asctime_r(localtime_r(timep, &tmBuf), buf);

Template Parameters

N – The size of buf; must be at least 26 characters.

Parameters
  • timep – A pointer to a time_t.

  • buf – The character buffer to render the string into. Must be at least 26 characters.

Returns

buf, or nullptr if an error occurs.