X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcommon%2Ftime.h;h=5ea8c66286f3d5d79ef9abdb959caa784debd697;hb=da7587b7850040b371b3a588a9d84535ea6cf530;hp=24513d30bff11618deeeaa74de2c86974f2d5d5f;hpb=03ab1b42f4cd0df99e8ee93c35b8c371d4385225;p=lttng-tools.git diff --git a/src/common/time.h b/src/common/time.h index 24513d30b..5ea8c6628 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -46,6 +46,9 @@ bool locale_supports_utf8(void); #define MIN_UNIT "m" #define HR_UNIT "h" +#define ISO8601_FORMAT "%Y%m%dT%H%M%S%z" +#define ISO8601_LEN 26 + /* * timespec_to_ms: Convert timespec to milliseconds. * @@ -61,4 +64,10 @@ int timespec_to_ms(struct timespec ts, unsigned long *ms); LTTNG_HIDDEN struct timespec timespec_abs_diff(struct timespec ts_a, struct timespec ts_b); +/* + * Format time_t to ISO8601 compatible format. + */ +LTTNG_HIDDEN +int time_t_to_ISO8601(char *s, size_t s_size, time_t time); + #endif /* LTTNG_TIME_H */