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?
Yes, you are missing something:
There are never 31 days in February, regardless of the year.
You have given it an invalid date.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With