summaryrefslogtreecommitdiff
path: root/src/modules/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/time.c')
-rw-r--r--src/modules/time.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/modules/time.c b/src/modules/time.c
index 84f894e..272c8f8 100644
--- a/src/modules/time.c
+++ b/src/modules/time.c
@@ -2,7 +2,13 @@
#include <stdlib.h>
#include <time.h>
-#include <tgmath.h>
+
+#define VALUE_SIZE 32
+
+struct time {
+ char value[VALUE_SIZE];
+};
+
struct time *
time_new()
@@ -24,6 +30,12 @@ time_update(struct time * t)
struct tm * tm;
time(&timer);
- tm = gmtime(&timer);
- strftime(t->value, TIME_VALUE_SIZE, "%F [%a] %T", tm);
+ tm = localtime(&timer);
+ strftime(t->value, VALUE_SIZE, "%F [%a] %T", tm);
+}
+
+const char *
+time_get_val(struct time * t)
+{
+ return t->value;
}