Boost C++ Libraries: Ticket #5195: time_duration visualizer works incorrectly with negative duration https://svn.boost.org/trac10/ticket/5195 <p> 86400000000 unsigned 64 bit integer is mixed with signed integers. The fix is to use 86400000000I64 instead, as follows: </p> <p> ;------------------------------------------------------------------------------ ; boost::posix_time::time_duration visualizer ; only works with microseconds resolution ;------------------------------------------------------------------------------ </p> <p> boost::posix_time::time_duration{ </p> <blockquote> <p> preview ( </p> <blockquote> <p> #( </p> <blockquote> <p> $c.ticks_.value_/86400000000I64, "d ", ($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000, "h ", ($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64)-3600000000*(($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000))/60000000, "m ", (($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64)-3600000000*(($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000))-60000000*(($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64) - 3600000000*(($c.ticks_.value_-86400000000I64*($c.ticks_.value_/86400000000I64))/3600000000))/60000000))/1000000, "s ", ($c.ticks_.value_%1000000)/1000, "ms ", $c.ticks_.value_%1000, "us" </p> </blockquote> <p> ) </p> </blockquote> <p> ) </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5195 Trac 1.4.3