X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Futils_time.h;h=5456dcc142053a3a619afcecc79171dc576dd7a5;hb=e2cb258c7b6ce456f4119fd1454c85b479fa3e2d;hp=4d88dccb6684ec3f4c823f3429ce5a9455d35e1a;hpb=7b64cc91d3307179557b25b6ece2349a088f4294;p=collectd.git diff --git a/src/daemon/utils_time.h b/src/daemon/utils_time.h index 4d88dccb..5456dcc1 100644 --- a/src/daemon/utils_time.h +++ b/src/daemon/utils_time.h @@ -82,15 +82,35 @@ extern cdtime_t cdtime_mock; cdtime_t cdtime (void); -#define RFC3339_SIZE 26 -#define RFC3339NANO_SIZE 36 +#define RFC3339_SIZE 26 /* 2006-01-02T15:04:05+00:00 */ +#define RFC3339NANO_SIZE 36 /* 2006-01-02T15:04:05.999999999+00:00 */ -/* rfc3339 formats a cdtime_t time in RFC 3339 format with second precision. */ -int rfc3339 (char *buffer, size_t buffer_size, cdtime_t t); +#define RFC3339_ZULU_SIZE 21 /* 2006-01-02T15:04:05Z */ +#define RFC3339NANO_ZULU_SIZE 31 /* 2006-01-02T15:04:05.999999999Z */ -/* rfc3339nano formats a cdtime_t time in RFC 3339 format with nanosecond +/* rfc3339 formats a cdtime_t time as UTC in RFC 3339 format with second * precision. */ +int rfc3339 (char *buffer, size_t buffer_size, cdtime_t t); + +/* rfc3339nano formats a cdtime_t as UTC time in RFC 3339 format with + * nanosecond precision. */ int rfc3339nano (char *buffer, size_t buffer_size, cdtime_t t); +/* rfc3339 formats a cdtime_t time as UTC in RFC 3339 zulu format with second + * precision. */ +int rfc3339_zulu (char *buffer, size_t buffer_size, cdtime_t t); + +/* rfc3339nano formats a cdtime_t time as UTC in RFC 3339 zulu format with + * nanosecond precision. */ +int rfc3339nano_zulu (char *buffer, size_t buffer_size, cdtime_t t); + +/* rfc3339 formats a cdtime_t time as local in RFC 3339 format with second + * precision. */ +int rfc3339_local (char *buffer, size_t buffer_size, cdtime_t t); + +/* rfc3339nano formats a cdtime_t time as local in RFC 3339 format with + * nanosecond precision. */ +int rfc3339nano_local (char *buffer, size_t buffer_size, cdtime_t t); + #endif /* UTILS_TIME_H */ /* vim: set sw=2 sts=2 et : */