Here is my IRB session
1.9.2p290 :020 > Date.strptime("31-2-2010", "%d-%m-%Y")
ArgumentError: invalid date
I have given the proper values, yet it is returning ArgumentError. Am I missing something here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you are missing something:
There are never 31 days in February, regardless of the year.
You have given it an invalid date.