]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/chrono/example/chrono_unit_test.cpp
1 // chrono_unit_test.cpp ----------------------------------------------------//
3 // Copyright 2008 Beman Dawes
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 #define _CRT_SECURE_NO_WARNINGS // disable VC++ foolishness
10 #include <boost/chrono/chrono.hpp>
17 = boost::chrono::system_clock::to_time_t(boost::chrono::system_clock::now());
20 // Windows CE does not define asctime()
21 struct tm
* t
= std::gmtime(&sys_time
);
23 << "system_clock::to_time_t(system_clock::now()) is "
24 << t
->tm_mon
<< "/" << t
->tm_mday
<< "/" << (1900 + t
->tm_year
) << " " << t
->tm_hour
<< ":" << t
->tm_min
<< ":" << t
->tm_sec
<< std::endl
;
27 << "system_clock::to_time_t(system_clock::now()) is "
28 << std::asctime(std::gmtime(&sys_time
)) << std::endl
;