aboutsummaryrefslogtreecommitdiff
path: root/analyzer/utils/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'analyzer/utils/time.c')
-rw-r--r--analyzer/utils/time.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/analyzer/utils/time.c b/analyzer/utils/time.c
new file mode 100644
index 0000000..72c0bc7
--- /dev/null
+++ b/analyzer/utils/time.c
@@ -0,0 +1,10 @@
+#include "time.h"
+
+#include <stdio.h>
+#include <time.h>
+
+void get_date_time_string(char *date_time) {
+ time_t now = time(NULL);
+ struct tm *t = localtime(&now);
+ sprintf(date_time, "%02d%02d%02d_%02d%02d%02d", t->tm_year - 100, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
+}