From: "john_firebaugh (John Firebaugh)" Date: 2012-03-23T12:21:57+09:00 Subject: [ruby-core:43569] [ruby-trunk - Bug #6193][Open] Time.new does not accept seconds as a String Issue #6193 has been reported by john_firebaugh (John Firebaugh). ---------------------------------------- Bug #6193: Time.new does not accept seconds as a String https://bugs.ruby-lang.org/issues/6193 Author: john_firebaugh (John Firebaugh) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0] 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:in `initialize' 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. -- http://bugs.ruby-lang.org/