diff options
| author | Sam Light <sam@lightscale.co.uk> | 2025-09-10 19:37:28 +0100 |
|---|---|---|
| committer | Sam Light <sam@lightscale.co.uk> | 2025-09-10 19:37:28 +0100 |
| commit | 4d3e462531d2172cb13319c7f79c0e2228e652fa (patch) | |
| tree | 6381426e806b30814890e74085afef17e3ee78f3 /src/modules/time.c | |
| parent | b74a383e6ded85c122f98137936d78f768f8f938 (diff) | |
Big update
Diffstat (limited to 'src/modules/time.c')
| -rw-r--r-- | src/modules/time.c | 18 |
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; } |
