diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:44 +0000 |
commit | 836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch) | |
tree | 1604da8f482d02effa033c94a84be42bc0c848c3 /libnetdata/datetime/rfc7231.c | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip |
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/datetime/rfc7231.c')
-rw-r--r-- | libnetdata/datetime/rfc7231.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/libnetdata/datetime/rfc7231.c b/libnetdata/datetime/rfc7231.c deleted file mode 100644 index 4925ed2c9..000000000 --- a/libnetdata/datetime/rfc7231.c +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -#include "../libnetdata.h" - -inline size_t rfc7231_datetime(char *buffer, size_t len, time_t now_t) { - if (unlikely(!buffer || !len)) - return 0; - - struct tm *tmp, tmbuf; - - // Use gmtime_r for UTC time conversion. - tmp = gmtime_r(&now_t, &tmbuf); - - if (unlikely(!tmp)) { - buffer[0] = '\0'; - return 0; - } - - // Format the date and time according to the RFC 7231 format. - size_t ret = strftime(buffer, len, "%a, %d %b %Y %H:%M:%S GMT", tmp); - if (unlikely(ret == 0)) - buffer[0] = '\0'; - - return ret; -} - -size_t rfc7231_datetime_ut(char *buffer, size_t len, usec_t now_ut) { - return rfc7231_datetime(buffer, len, (time_t) (now_ut / USEC_PER_SEC)); -} |