Calculate the Number of Days Between Two Days in Ruby

0
3642

This coding exercise focuses on how to perform date calculations. Specifically, you’ll need to find the total number of days that have transpired between Christmas day in 2016 and July 1, 2004 (approximately when Rails when released as an open source project).

Summary

Build a program that counts the number of days between two dates.

Exercise File

Code File

Exercise Description

Build a method to find the total number of days that have transpired between Christmas day in 2016 and July 1, 2004 (approximately when Rails when released as an open source project).

The total number of days should be

4560

Real World Usage

Performing date calculations is important in a number of algorithms, including: scheduling applications, calendar APIs, and any date/time related programs.

Solution

Can be found on the solutions branch on github.

LEAVE A REPLY

Please enter your comment!
Please enter your name here