1 //===- Win32/TimeValue.cpp - Win32 TimeValue Implementation -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Jeff Cohen and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides the Win32 implementation of the TimeValue class.
12 //===----------------------------------------------------------------------===//
20 //===----------------------------------------------------------------------===//
21 //=== WARNING: Implementation here must contain only Win32 specific code.
22 //===----------------------------------------------------------------------===//
24 TimeValue TimeValue::now() {
26 GetSystemTimeAsFileTime(reinterpret_cast<FILETIME *>(&ft));
33 std::string TimeValue::toString() const {
34 // Alas, asctime is not re-entrant on Windows...
36 __time64_t ourTime = this->toEpochTime();
37 char* buffer = ::asctime(::_localtime64(&ourTime));
39 std::string result(buffer);
40 return result.substr(0,24);
43 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab