aboutsummaryrefslogtreecommitdiff
path: root/lib/System/Unix/TimeValue.inc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/System/Unix/TimeValue.inc')
-rw-r--r--lib/System/Unix/TimeValue.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/System/Unix/TimeValue.inc b/lib/System/Unix/TimeValue.inc
index 1fbedcab4f..f029f8dadc 100644
--- a/lib/System/Unix/TimeValue.inc
+++ b/lib/System/Unix/TimeValue.inc
@@ -18,5 +18,21 @@
#include "Unix.h"
+#include <time.h>
+
+namespace llvm {
+ using namespace sys;
+
+
+std::string TimeValue::toString() {
+ char buffer[32];
+
+ time_t ourTime = time_t(this->toEpochTime());
+ ::asctime_r(::localtime(&ourTime), buffer);
+
+ std::string result(buffer);
+ return result.substr(0,24);
+}
+
}
// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab