<div class="gmail_quote">On Sun, Jan 13, 2008 at 11:11 AM, Soren Dreijer <span dir="ltr">&lt;<a href="mailto:admin@blacksmith-studios.dk">admin@blacksmith-studios.dk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;m creating a posix_time::time_duration object based on the minutes()<br>
helper function. If I specify a large value, such as 2000, I get a<br>
time_duration of 33:20:00. Take a look at the following piece of code,<br>
though:<br>
<br>
time_duration td = minutes(2000);<br>
cout &lt;&lt; to_simple_string(td); // OK<br>
cout &lt;&lt; td; // Fails with an assertion in VS2008<br>
<br>
The latter call fails with the following assertion in strftime.c on line<br>
658:<br>
_VALIDATE_RETURN( ( ( timeptr-&gt;tm_hour &gt;=0 ) &amp;&amp; ( timeptr-&gt;tm_hour &lt;=<br>
23 ) ), EINVAL, FALSE)<br>
<br>
Apparently, operator&lt;&lt; expands to _expandtime(), which doesn&#39;t allow values<br>
for the hour to be greater than 23. Is this intended behavior, or should I<br>
just always use to_simple_string() rather than the convenient operator&lt;&lt; ?<br>
<br></blockquote></div><br><div>I&#39;m seeing a similar problem, but did not see any replies to this. &nbsp;Does anyone know the answer? &nbsp;I&#39;m using boost 1.34.1; has this been fixed in a newer version? &nbsp;There is no to_simple_string() method for this class, at least not in this version of boost.<br>
<br></div>