// Copyright 2013 Vicente J. Botet Escriba // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/libs/chrono for documentation. #define BOOST_CHRONO_VERSION 2 //#define BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT 1 #include #include #include #include #include #include #include #include int main() { using namespace boost; using namespace boost::chrono; boost::chrono::system_clock::time_point atnow= boost::chrono::system_clock::now(); { std::stringstream strm; std::stringstream strm2; // does not change anything: strm<>atnow2; strm2<(atnow2 - atnow).count() <(atnow2 - atnow).count(), 0); std::stringstream formatted; formatted << time_fmt(boost::chrono::timezone::utc, "%Y-%m-%d %H:%M:%S"); formatted << "actual:"<< atnow <>atnow2; strm2<(atnow2 - atnow).count(), 0); } return boost::report_errors(); }