Vidyalelo
Ruby Programming · Q15

Working with Dates and Times in Ruby

Programming · Ruby Programming · question 15

Q15

How do you find the number of months between two Date objects in Ruby?

A.
Use the delta method with the months option
B.
Use the difference method with the months option
C.
Subtract one Date object from another and calculate the difference in months
Answer
D.
Use the months_between method

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board