summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authoryellow <yellow@10gen.com>2008-02-25 22:18:01 +0000
committeryellow <yellow@10gen.com>2008-02-25 22:18:01 +0000
commitdc20e53904feaeccd03c2b864af58e7ef017816e (patch)
treec0839cdebea7f37bf7dff7879a9711774974054f /util
parent3be5d865852314623301dd1d7803f42c8a8c3d68 (diff)
parent3fc3a61fdabc5eb663348b2d1dc5080bbdde6823 (diff)
downloadmongo-dc20e53904feaeccd03c2b864af58e7ef017816e.tar.gz
Merge branch 'master' of /data/gitroot/p/
Diffstat (limited to 'util')
-rw-r--r--util/goodies.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/goodies.h b/util/goodies.h
index 98aefd68981..4fa657600bc 100644
--- a/util/goodies.h
+++ b/util/goodies.h
@@ -63,6 +63,17 @@ struct WrappingInt {
bool operator>(WrappingInt r) { return !(r<=*this); }
};
+#include <ctime>
+
+inline void time_t_to_String(time_t t, char *buf) {
+#if defined(_WIN32)
+ ctime_s(buf, 64, &t);
+#else
+ ctime_r(&t, buf);
+#endif
+ buf[24] = 0; // don't want the \n
+}
+
inline void sleepsecs(int s) {
boost::xtime xt;
boost::xtime_get(&xt, boost::TIME_UTC);