Consider this piece of code (compiled with VS2015, using boost 1.60:
#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <iostream>
int main( int argc, char* argv[] )
{
uint64_t val = static_cast<uint64_t>( 5000000000 * 1000000 );
std::cout << val << std::endl;
boost::posix_time::time_duration the = boost::posix_time::microseconds( val );
std::cout << the << std::endl;
auto res3 = the.total_seconds();
std::cout << res3 << std::endl;
return 0;
}
It outputs:
5000000000000000
1388888:53:20
705032704
Two first lines are OK. However, last line should report 5000000000 (5000000000000000 microseconds is 5000000000 seconds....which is exactly (1388888*3600+53*60+20)).
Where does this 705032704 comes from??