summaryrefslogtreecommitdiff
path: root/src/utils/time_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/time_info.c')
-rw-r--r--src/utils/time_info.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/time_info.c b/src/utils/time_info.c
new file mode 100644
index 0000000..f825a72
--- /dev/null
+++ b/src/utils/time_info.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+void sec2timestamp(int seconds, char **p_ts) {
+ int hours = seconds / 3600;
+ int minutes = (seconds % 3600) / 60;
+ int secs = seconds % 60;
+ sprintf(*p_ts, "%02d:%02d:%02d", hours, minutes, secs);
+}