-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 @@ | |||
1 | #include <napkin/util.h> | ||
2 | |||
3 | namespace napkin { | ||
4 | |||
5 | string strftime(const char *fmt,time_t t) { | ||
6 | struct tm tt; | ||
7 | localtime_r(&t,&tt);// TODO: check res | ||
8 | char rv[1024]; | ||
9 | strftime(rv,sizeof(rv),fmt,&tt); // TODO: check res | ||
10 | return rv; | ||
11 | } | ||
12 | |||
13 | } | ||