Xinqi Bao's Git

Split into multiple files
[slstatus.git] / datetime.c
1 #include <time.h>
2
3 #include "util.h"
4
5 const char *
6 datetime(const char *fmt)
7 {
8 time_t t;
9
10 t = time(NULL);
11 if (strftime(buf, sizeof(buf), fmt, localtime(&t)) == 0)
12 return NULL;
13
14 return buf;
15 }