diff options
Diffstat (limited to '')
-rw-r--r-- | src/libnetdata/datetime/README.md | 11 | ||||
-rw-r--r-- | src/libnetdata/datetime/iso8601.c (renamed from libnetdata/datetime/iso8601.c) | 0 | ||||
-rw-r--r-- | src/libnetdata/datetime/iso8601.h (renamed from libnetdata/datetime/iso8601.h) | 0 | ||||
-rw-r--r-- | src/libnetdata/datetime/rfc3339.c (renamed from libnetdata/datetime/rfc3339.c) | 6 | ||||
-rw-r--r-- | src/libnetdata/datetime/rfc3339.h (renamed from libnetdata/datetime/rfc3339.h) | 0 | ||||
-rw-r--r-- | src/libnetdata/datetime/rfc7231.c (renamed from libnetdata/datetime/rfc7231.c) | 0 | ||||
-rw-r--r-- | src/libnetdata/datetime/rfc7231.h (renamed from libnetdata/datetime/rfc7231.h) | 0 |
7 files changed, 14 insertions, 3 deletions
diff --git a/src/libnetdata/datetime/README.md b/src/libnetdata/datetime/README.md new file mode 100644 index 000000000..303ba8bf2 --- /dev/null +++ b/src/libnetdata/datetime/README.md @@ -0,0 +1,11 @@ +<!-- +title: "Datetime" +custom_edit_url: https://github.com/netdata/netdata/edit/master/src/libnetdata/datetime/README.md +sidebar_label: "Datetime" +learn_topic_type: "Tasks" +learn_rel_path: "Developers/libnetdata" +--> + +# Datetime + +Formatting dates and timestamps. diff --git a/libnetdata/datetime/iso8601.c b/src/libnetdata/datetime/iso8601.c index 8e3f4e027..8e3f4e027 100644 --- a/libnetdata/datetime/iso8601.c +++ b/src/libnetdata/datetime/iso8601.c diff --git a/libnetdata/datetime/iso8601.h b/src/libnetdata/datetime/iso8601.h index ce4800963..ce4800963 100644 --- a/libnetdata/datetime/iso8601.h +++ b/src/libnetdata/datetime/iso8601.h diff --git a/libnetdata/datetime/rfc3339.c b/src/libnetdata/datetime/rfc3339.c index 157e340d3..5c4e990dd 100644 --- a/libnetdata/datetime/rfc3339.c +++ b/src/libnetdata/datetime/rfc3339.c @@ -27,7 +27,7 @@ size_t rfc3339_datetime_ut(char *buffer, size_t len, usec_t now_ut, size_t fract return 0; } - if (fractional_digits >= 0 && fractional_digits <= 9) { + if (fractional_digits >= 1 && fractional_digits <= 9) { int fractional_part = (int)(now_ut % USEC_PER_SEC); if (fractional_part && len - used_length > fractional_digits + 1) { char format[] = ".%01d"; @@ -102,8 +102,8 @@ usec_t rfc3339_parse_ut(const char *rfc3339, char **endptr) { if (*s == '+' || *s == '-') { // Parse the hours:mins part of the timezone - if (!isdigit(s[1]) || !isdigit(s[2]) || s[3] != ':' || - !isdigit(s[4]) || !isdigit(s[5])) + if (!isdigit((uint8_t)s[1]) || !isdigit((uint8_t)s[2]) || s[3] != ':' || + !isdigit((uint8_t)s[4]) || !isdigit((uint8_t)s[5])) return 0; // Parsing error char tz_sign = *s; diff --git a/libnetdata/datetime/rfc3339.h b/src/libnetdata/datetime/rfc3339.h index 88ebb3ec8..88ebb3ec8 100644 --- a/libnetdata/datetime/rfc3339.h +++ b/src/libnetdata/datetime/rfc3339.h diff --git a/libnetdata/datetime/rfc7231.c b/src/libnetdata/datetime/rfc7231.c index 4925ed2c9..4925ed2c9 100644 --- a/libnetdata/datetime/rfc7231.c +++ b/src/libnetdata/datetime/rfc7231.c diff --git a/libnetdata/datetime/rfc7231.h b/src/libnetdata/datetime/rfc7231.h index 5ba93053f..5ba93053f 100644 --- a/libnetdata/datetime/rfc7231.h +++ b/src/libnetdata/datetime/rfc7231.h |