-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
In the DOOCS clientlib we have functions for formatting local time:
/**
* Convert a timestamp into local time and format it into a std::string using strftime()
* format specifiers.
*
* Due to the limitations of strftime(), this function does not support sub-second
* output precision.
*
* \param ts The timestamp to be formatted.
* \param fmt A format string following the specifications of strftime(), see
* https://en.cppreference.com/w/cpp/chrono/c/strftime . If fmt is a null
* pointer, an empty string is returned. The default format generates an
ISO 8601 compliant date-time string.
* \returns a string with the formatted output or an empty string if an error occurred.
*/
std::string format_localtime (Timestamp ts, const char *fmt = "%Y-%m-%dT%H:%M:%S");
std::string format_localtime (std::time_t t, const char *fmt = "%Y-%m-%dT%H:%M:%S");
Such functions are useful also for other projects (both for UTC and local times). I'd say we could use them in GUL14.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request