diff options
Diffstat (limited to 'ucb/source/ucp/cmis/cmis_content.cxx')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index a32fdbbb11d3..3675a706c5e1 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -85,11 +85,13 @@ namespace unoTime.Minutes = boostTime.time_of_day().minutes(); unoTime.Seconds = boostTime.time_of_day().seconds(); - long total_milli = boostTime.time_of_day().total_milliseconds( ); - long milli = total_milli - boostTime.time_of_day().total_seconds( ); - long hundredthSeconds = milli / 10; + // TODO FIXME maybe we should compile with BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG + // to actually get nanosecond precision in boostTime? + // use this way rather than total_nanos to avoid overflows with 32-bit long + const long ticks = boostTime.time_of_day().fractional_seconds(); + long nanoSeconds = ticks * ( 1000000000 / boost::posix_time::time_duration::ticks_per_second()); - unoTime.HundredthSeconds = hundredthSeconds; + unoTime.NanoSeconds = nanoSeconds; return unoTime; } |