Given your input, Date.parse parses your dates if they are in YY/MM/DD format, so when it tries to parse 11/25/08 , it fails because the month 25 invalid:
d = Date.parse('11/12/08 10:47') d.year # => 2011 d.month # => 12 d.day # => 8 Date.parse('11/25/08 19:21') # ArgumentError: invalid date
Given that your dates are all in one format, you should use Date.strptime :
d = Date.strptime('11/12/08 10:47', '%m/%d/%y') d.year # => 2008 d.month # => 11 d.day # => 12 Date.strptime('11/25/08 19:21', '%m/%d/%y') # => #<Date: 2008-11-25 ((2454796j,0s,0n),+0s,2299161j)>
Edit Instead of the format string %m/%d/%y you can use the %D shortcut:
Date.strptime('11/25/08 19:21', '%D')
source share