id summary reporter owner description type status milestone component version severity resolution keywords cc 11813 Microseconds get cut off in ISO string representation if all zero (posix_time::to_iso_string) Marcel Glacki az_sw_dude " {{{ #include #include #include int main() { boost::posix_time::ptime timestamp = boost::posix_time::microsec_clock::local_time(); std::string sTime( boost::posix_time::to_iso_string( timestamp )); std::cout << ""Timestamp: "" << sTime << std::endl; return 0; } }}} This outputs for example: ''Timestamp: 20151121T141522.999982'' Now, if microseconds are all zero the output I'd expected was[[BR]] ''Timestamp: 20151121T141523.000000''[[BR]] but actually is[[BR]] ''Timestamp: 20151121T141523'' Now, when trying to cut off the microseconds fraction (for whatever reason) by doing {{{ std::string sFraction = sTime.substr( 16, 21 ); }}} you may end up with the following error: {{{ Something unexpected happened: 'basic_string::substr: __pos (which is 16) > this->size() (which is 15)' }}} I saw this behavior in Boost 1.55.0, but when I checked the current sources online, I couldn't see any difference, so I think this would occur in the current version, too." Bugs new To Be Determined date_time Boost 1.55.0 Problem posix_time microseconds to_iso_string