-rw-r--r-- | lib/util.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/util.cc b/lib/util.cc new file mode 100644 index 0000000..350cbac --- a/dev/null +++ b/lib/util.cc @@ -0,0 +1,13 @@ +#include <napkin/util.h> + +namespace napkin { + + string strftime(const char *fmt,time_t t) { + struct tm tt; + localtime_r(&t,&tt);// TODO: check res + char rv[1024]; + strftime(rv,sizeof(rv),fmt,&tt); // TODO: check res + return rv; + } + +} |