1 //===- Win32/TimeValue.cpp - Win32 TimeValue Implementation -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // 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::str() const {
35 __time64_t OurTime = this->toEpochTime();
36 int Error = ::_localtime64_s(<, &OurTime);
40 // FIXME: the windows version of strftime doesn't support %e
41 strftime(Buffer, 25, "%b %d %H:%M %Y", <);
42 return std::string(Buffer);