Created
August 1, 2014 01:36
-
-
Save thatdutchguy/2be0d51294b7ccc9bf7f to your computer and use it in GitHub Desktop.
Ruby Time.parse exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ » ruby -v | |
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] | |
~ » pry | |
[1] pry(main)> require 'time' | |
=> true | |
[2] pry(main)> time_string = "2013" | |
=> "2013" | |
[3] pry(main)> DateTime.parse time_string | |
ArgumentError: invalid date | |
from (pry):3:in `parse' | |
[4] pry(main)> Time.parse time_string | |
ArgumentError: argument out of range | |
from /Users/Daniel/.rubies/ruby-2.1.2/lib/ruby/2.1.0/time.rb:264:in `local' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment