Hi,<div><br></div><div>Any help here is appreciated. </div><div><br></div><div>I found a related unit test here:</div><div><br></div><div>main\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py:</div>
<div><br></div><div><div> def test_total_seconds(self):</div><div> td = timedelta(days=365)</div><div> self.assertEqual(td.total_seconds(), 31536000.0)</div><div> for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]:</div>
<div> td = timedelta(seconds=total_seconds)</div><div> self.assertEqual(td.total_seconds(), total_seconds)</div><div> # Issue8644: Test that td.total_seconds() has the same</div><div> # accuracy as td / timedelta(seconds=1).</div>
<div> for ms in [-1, -2, -123]:</div><div> td = timedelta(microseconds=ms)</div><div> self.assertEqual(td.total_seconds(),</div><div> ((24*3600*td.days + td.seconds)*10**6</div>
<div> + td.microseconds)/10**6)</div></div><div><br></div><div><br></div><div>I would like to know how to enable and run this in the build.</div><div><br></div><div>Thank you very much.</div><div>
Mello</div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy <span dir="ltr"><<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just an oversight. Can you open an issue on <a href="http://ironpython.codeplex.com" target="_blank">ironpython.codeplex.com</a>?<br>
Should be easy enough to get this in. If you're up to it, a pull<br>
request would be even better :)<br>
<br>
- Jeff<br>
<div><div class="h5"><br>
On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello <<a href="mailto:cmello@gmail.com">cmello@gmail.com</a>> wrote:<br>
> Hi!<br>
><br>
> This method doesn't seem to be implemented. From<br>
> <a href="http://docs.python.org/library/datetime.html" target="_blank">http://docs.python.org/library/datetime.html</a> :<br>
> timedelta.total_seconds()<br>
><br>
> Return the total number of seconds contained in the duration. Equivalent to<br>
> (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6<br>
> computed with true division enabled.<br>
><br>
> Note that for very large time intervals (greater than 270 years on most<br>
> platforms) this method will lose microsecond accuracy.<br>
><br>
> New in version 2.7.<br>
><br>
><br>
> Best regards!<br>
> Mello<br>
><br>
</div></div>> _______________________________________________<br>
> Ironpython-users mailing list<br>
> <a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
><br>
</blockquote></div><br></div>