X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Ftime.h;h=8588cf554c487912875253cd81f1631529bda38a;hb=9d16fc7fa401926b800c18124756d75b11b5b806;hp=60d0a9bd5dcd8aa7faa56e8577d2e1f2e381ce0f;hpb=79064e4e3acf75b4acda0dbd2c9f0671302dbb2d;p=lttng-tools.git diff --git a/src/common/time.h b/src/common/time.h index 60d0a9bd5..8588cf554 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -22,14 +22,13 @@ #include #include #include +#include #define MSEC_PER_SEC 1000ULL #define NSEC_PER_SEC 1000000000ULL #define NSEC_PER_MSEC 1000000ULL #define NSEC_PER_USEC 1000ULL -#ifndef USEC_PER_SEC #define USEC_PER_SEC 1000000ULL -#endif #define USEC_PER_MSEC 1000ULL #define SEC_PER_MINUTE 60ULL @@ -39,6 +38,7 @@ #define USEC_PER_HOURS (USEC_PER_MINUTE * MINUTE_PER_HOUR) #define ISO8601_STR_LEN sizeof("YYYYmmddTHHMMSS+HHMM") +#define DATETIME_STR_LEN sizeof("YYYYmmdd-HHMMSS") LTTNG_HIDDEN bool locale_supports_utf8(void); @@ -75,4 +75,7 @@ struct timespec timespec_abs_diff(struct timespec ts_a, struct timespec ts_b); LTTNG_HIDDEN int time_to_iso8601_str(time_t time, char *str, size_t len); +LTTNG_HIDDEN +int time_to_datetime_str(time_t time, char *str, size_t len); + #endif /* LTTNG_TIME_H */