Currently i am upgrading my application from ruby 1.8.7 to ruby 2. I got the following issue datetime.
Ruby 1.8.7 console:
u=User.find :last
=> #<User id: 1191, login: "srivaishvi@gmail.com", name: "Sri Lakshmi", email: "srivaishvi.local@gmail.com" , created_at: "2014-01-27 12:09:04", updated_at: "2014-01-28 15:57:23">
u.updated_at="1/13/2014"
=> "1/13/2014"
u.save
=> true
Ruby 2 console:
u=User.find :last
=> #<User id: 1191, login: "srivaishvi@gmail.com", name: "Sri Lakshmi", email: "srivaishvi.local@gmail.com" , created_at: "2014-01-27 12:09:04", updated_at: "2014-01-28 15:57:23">
u.updated_at="1/13/2014"
=> "1/13/2014"
u.save
*****ArgumentError: argument out of range*****
I want the Ruby 1.8.7 datetime format in Ruby 2. I would like to keep using format I used in Ruby 1.8.7.