summaryrefslogtreecommitdiffstats
path: root/app/time_fn.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/time_fn.c')
-rw-r--r--app/time_fn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/time_fn.c b/app/time_fn.c
index 1067dd9..957bc47 100644
--- a/app/time_fn.c
+++ b/app/time_fn.c
@@ -209,6 +209,13 @@ EPOCH time_utc_to_epoch (UTC u)
return ret;
}
+void utc_to_str (char *dst, UTC u)
+{
+ const char *dname[] = {"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat", "Sun"};
+ const char *mname[] = {"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+ sprintf (dst, "%s %04d-%s-%02d %02d:%02d:%02d.%09d", dname[u.wday], u.year, mname[u.month], u.mday, u.hour, u.minute, u.second, u.nanosecond);
+}
+
void time_print_utc (const char *p, UTC u)
{