X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ftime.h;fp=src%2Fcommon%2Ftime.h;h=7e760599fd54ba6c2f0f8c2e400b5c4e00f1e0d1;hp=24513d30bff11618deeeaa74de2c86974f2d5d5f;hb=d77fb8c7d20b34918268fea841acd11c0507b034;hpb=e26422e8271348d43f1282cb2ee46e01ea73adbd diff --git a/src/common/time.h b/src/common/time.h index 24513d30b..7e760599f 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 21 + /* * 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 */