diff options
author | Karel Zak | 2016-05-11 15:31:02 +0200 |
---|---|---|
committer | Karel Zak | 2016-05-11 15:31:02 +0200 |
commit | 3c201431ee26c85b5c7fbcd85856c1df84065d64 (patch) | |
tree | a6ff93a95304bcf4f8241f409c2f3a6bf5c90ecb /include/timeutils.h | |
parent | ramctl: add support for zram-control (diff) | |
download | kernel-qcow2-util-linux-3c201431ee26c85b5c7fbcd85856c1df84065d64.tar.gz kernel-qcow2-util-linux-3c201431ee26c85b5c7fbcd85856c1df84065d64.tar.xz kernel-qcow2-util-linux-3c201431ee26c85b5c7fbcd85856c1df84065d64.zip |
lib/timeutils: add strxxx_iso() functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/timeutils.h')
-rw-r--r-- | include/timeutils.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/timeutils.h b/include/timeutils.h index 8ed501b9d..4b6098ae1 100644 --- a/include/timeutils.h +++ b/include/timeutils.h @@ -23,6 +23,7 @@ #include <stdio.h> #include <inttypes.h> +#include <sys/time.h> typedef uint64_t usec_t; typedef uint64_t nsec_t; @@ -53,4 +54,16 @@ typedef uint64_t nsec_t; int parse_timestamp(const char *t, usec_t *usec); +/* flags for strxxx_iso() functions */ +enum { + ISO_8601_DATE = (1 << 1), + ISO_8601_TIME = (1 << 2), + ISO_8601_USEC = (1 << 3), + ISO_8601_TIMEZONE = (1 << 4), + ISO_8601_SPACE = (1 << 5) +}; +char *strtimeval_iso(struct timeval *tv, int flags); +char *strtm_iso(struct tm *tm, int flags); +char *strtime_iso(time_t t, int flags); + #endif /* UTIL_LINUX_TIME_UTIL_H */ |