#include #include #include #include "misc.h" char * date(int timestamp) { char *buf; time_t *t; if(!(buf = malloc(20))) err(1, "malloc"); t = localtime(×tamp); strftime(buf, 20, "%Y-%m-%d %H:%M", t); return buf; }