13 Jan
2008
13 Jan
'08
5:11 p.m.
I'm creating a posix_time::time_duration object based on the minutes() helper function. If I specify a large value, such as 2000, I get a time_duration of 33:20:00. Take a look at the following piece of code, though: time_duration td = minutes(2000); cout << to_simple_string(td); // OK cout << td; // Fails with an assertion in VS2008 The latter call fails with the following assertion in strftime.c on line 658: _VALIDATE_RETURN( ( ( timeptr->tm_hour >=0 ) && ( timeptr->tm_hour <= 23 ) ), EINVAL, FALSE) Apparently, operator<< expands to _expandtime(), which doesn't allow values for the hour to be greater than 23. Is this intended behavior, or should I just always use to_simple_string() rather than the convenient operator<< ?