summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r--src/shared/time-util.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index 09f4a21354..433c262dfa 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -152,7 +152,7 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) {
return tv;
}
-char *format_timestamp_internal(char *buf, size_t l, usec_t t, bool utc) {
+static char *format_timestamp_internal(char *buf, size_t l, usec_t t, bool utc) {
struct tm tm;
time_t sec;
@@ -178,7 +178,11 @@ char *format_timestamp(char *buf, size_t l, usec_t t) {
return format_timestamp_internal(buf, l, t, false);
}
-char *format_timestamp_us(char *buf, size_t l, usec_t t, bool utc) {
+char *format_timestamp_utc(char *buf, size_t l, usec_t t) {
+ return format_timestamp_internal(buf, l, t, true);
+}
+
+static char *format_timestamp_internal_us(char *buf, size_t l, usec_t t, bool utc) {
struct tm tm;
time_t sec;
@@ -203,6 +207,14 @@ char *format_timestamp_us(char *buf, size_t l, usec_t t, bool utc) {
return buf;
}
+char *format_timestamp_us(char *buf, size_t l, usec_t t) {
+ return format_timestamp_internal_us(buf, l, t, false);
+}
+
+char *format_timestamp_us_utc(char *buf, size_t l, usec_t t) {
+ return format_timestamp_internal_us(buf, l, t, true);
+}
+
char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
const char *s;
usec_t n, d;