Ticket #3105: microsec_time_clock.hpp.patch
File microsec_time_clock.hpp.patch, 1.4 KB (added by , 13 years ago) |
---|
-
microsec_time_clock.hpp
old new 1 1 #ifndef DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ 2 2 #define DATE_TIME_HIGHRES_TIME_CLOCK_HPP___ 3 3 4 /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc.4 /* Copyright (c) 2002,2003,2005,2009 CrystalClear Software, Inc. 5 5 * Use, modification and distribution is subject to the 6 6 * Boost Software License, Version 1.0. (See accompanying 7 7 * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) … … 66 66 private: 67 67 // we want this enum available for both platforms yet still private 68 68 enum TZ_FOR_CREATE { LOCAL, GMT }; 69 69 70 70 public: 71 71 72 72 #ifdef BOOST_HAS_GETTIMEOFDAY … … 129 129 #endif 130 130 return create_time(ft, LOCAL); 131 131 } 132 132 133 133 //! Return the UTC time based on computer settings 134 134 static time_type universal_time() { 135 135 FILETIME ft; … … 165 165 // microseconds -- static casts supress warnings 166 166 boost::uint32_t sub_sec = static_cast<boost::uint32_t>((filetime % 10000000) / 10); 167 167 168 std::time_t t = static_cast< time_t>(filetime / 10000000); // seconds since epoch169 168 std::time_t t = static_cast<std::time_t>(filetime / 10000000); // seconds since epoch 169 170 170 std::tm curr, *curr_ptr = 0; 171 171 if (tz == LOCAL) { 172 172 curr_ptr = c_time::localtime(&t, &curr);