From d351871d9b2cd7788274a47a2b8a23dbba663288 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 14 Nov 2004 22:10:08 +0000 Subject: Implement the toString method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17782 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/System/Unix/TimeValue.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/System/Unix/TimeValue.inc') 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 + +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 -- cgit v1.2.3-18-g5258