Actions
Bug #6193
closedTime.new does not accept seconds as a String
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Backport:
Description
Time.new accepts any or all of the year, month, day, hour, or minute specified as a String, but does not accept a String value for seconds:
Time.new("2012", "3", "22", "8", "19", 30)
=> 2012-03-22 08:19:30 -0700
Time.new("2012", "3", "22", "8", "19", "30")
TypeError: can't convert String into an exact number
from (irb):222:ininitialize' from (irb):222:in
new'
from (irb):222
from /Users/john/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `'
Since all other arguments can be strings, and since Time.utc and Time.local accept String seconds, I believe the expected behavior is that Time.new does as well.
Files
Actions
Like0
Like0Like0Like0Like0