X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_time.h;fp=src%2Fdaemon%2Futils_time.h;h=07e560afd373a8978c56b2691313c308d394355d;hb=349d1538fc57c320270c471c9a8c7e11d5aa3631;hp=6566a739bdf8be34b695a3d715dd90b7644e2f23;hpb=ef07224d5a3e24ccbc71765194d91a8e00ce16fc;p=collectd.git diff --git a/src/daemon/utils_time.h b/src/daemon/utils_time.h index 6566a739..07e560af 100644 --- a/src/daemon/utils_time.h +++ b/src/daemon/utils_time.h @@ -76,11 +76,15 @@ cdtime_t cdtime (void); -/* format a cdtime_t value in ISO 8601 format: - * returns the number of characters written to the string (not including the - * terminating null byte or 0 on error; the function ensures that the string - * is null terminated */ -size_t cdtime_to_iso8601 (char *s, size_t max, cdtime_t t); +#define RFC3339_SIZE 26 +#define RFC3339NANO_SIZE 36 + +/* rfc3339 formats a cdtime_t time in RFC 3339 format with second precision. */ +int rfc3339 (char *buffer, size_t buffer_size, cdtime_t t); + +/* rfc3339nano formats a cdtime_t time in RFC 3339 format with nanosecond + * precision. */ +int rfc3339nano (char *buffer, size_t buffer_size, cdtime_t t); #endif /* UTILS_TIME_H */ /* vim: set sw=2 sts=2 et : */