https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-05-05T09:56:05ZRuby Issue Tracking SystemRuby 1.8 - Feature #4644: DateTime.new does not work with Floathttps://bugs.ruby-lang.org/issues/4644?journal_id=167732011-05-05T09:56:05Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Tracker</strong> changed from <i>Bug</i> to <i>Feature</i></li></ul> Ruby 1.8 - Feature #4644: DateTime.new does not work with Floathttps://bugs.ruby-lang.org/issues/4644?journal_id=176202011-06-09T08:38:34Ztadf (tadayoshi funaba)
<ul><li><strong>Assignee</strong> set to <i>tadf (tadayoshi funaba)</i></li></ul> Ruby 1.8 - Feature #4644: DateTime.new does not work with Floathttps://bugs.ruby-lang.org/issues/4644?journal_id=176242011-06-09T09:23:06Zcjheath (Clifford Heath)clifford.heath@gmail.com
<ul></ul><p>On 09/06/2011, at 9:38 AM, Stefan Radomski wrote:</p>
<blockquote>
<p>When initializing a DateTime object, one can pass seconds as Floats,<br>
like 5.5. The decimals get added to sec_fraction. This works great<br>
in Ruby 1.9, but not in 1.8.</p>
</blockquote>
<p>Even more amazing to me, is that you can't pass a DateTime to<br>
DateTime.new,<br>
and the same for Date. Surely you should be able to construct one from<br>
another?</p>
<p>I should probably raise a separate issue for this...?</p>
<p>Clifford Heath.</p> Ruby 1.8 - Feature #4644: DateTime.new does not work with Floathttps://bugs.ruby-lang.org/issues/4644?journal_id=176322011-06-09T19:47:33Ztadf (tadayoshi funaba)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>accepts flonum without Float#to_r.<br>
anyway.</p>