From 4d3e462531d2172cb13319c7f79c0e2228e652fa Mon Sep 17 00:00:00 2001 From: Sam Light Date: Wed, 10 Sep 2025 19:37:28 +0100 Subject: Big update --- src/modules/time.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/modules/time.c') 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 #include -#include + +#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; } -- cgit v1.2.3