#include "time.h" #include #include #include struct time * time_new() { struct time * t = malloc(sizeof(struct time)); return t; } void time_free(struct time * t) { free(t); } void time_update(struct time * t) { time_t timer; struct tm * tm; time(&timer); tm = gmtime(&timer); strftime(t->value, TIME_VALUE_SIZE, "%F [%a] %T", tm); }