summaryrefslogtreecommitdiff
path: root/src/modules/time.c
diff options
context:
space:
mode:
authorSam Light <sam@lightscale.co.uk>2025-09-10 19:37:28 +0100
committerSam Light <sam@lightscale.co.uk>2025-09-10 19:37:28 +0100
commit4d3e462531d2172cb13319c7f79c0e2228e652fa (patch)
tree6381426e806b30814890e74085afef17e3ee78f3 /src/modules/time.c
parentb74a383e6ded85c122f98137936d78f768f8f938 (diff)
Big update
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;
}