Extras Handy Commands Flashcards
1
Q
If you want to compare the date written as a string to an actual date object, like Date.today. How would you do this?
A
def card_expired?(exp_date)
Date.strptime(exp_date, ‘%m/%y’)
end
Ruby > Extras Handy Commands > Flashcards
If you want to compare the date written as a string to an actual date object, like Date.today. How would you do this?
def card_expired?(exp_date)
Date.strptime(exp_date, ‘%m/%y’)
end