Cody

# Problem 42353. Can't wait for NewYear ball drop !

Solution 703603

Submitted on 20 Jul 2015 by James
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% x = '2014-12-31 10:15:45'; y_correct = '000 days, 13 hours, 44 minutes, 15 seconds to go.'; assert(isequal(CantWaitTillBallDrops(x),y_correct))

Y = 2014 M = 12 D = 31 H = 10 MN = 15 S = 45 junk = 0.5724 Y = 0 M = 0 D = 0 H = 13 MN = 44 S = 15 ans = 000 days, 13 hours, 44 minutes, 15 seconds to go.

2   Pass
%% x = '2014-05-26 10:15:45'; y_correct = '219 days, 13 hours, 44 minutes, 15 seconds to go.'; assert(isequal(CantWaitTillBallDrops(x),y_correct))

Y = 2014 M = 5 D = 26 H = 10 MN = 15 S = 45 junk = 219.5724 Y = 0 M = 8 D = 6 H = 13 MN = 44 S = 15 ans = 219 days, 13 hours, 44 minutes, 15 seconds to go.

3   Pass
%% x = '2015-12-30'; y_correct = '002 days, 00 hours, 00 minutes, 00 seconds to go.'; assert(isequal(CantWaitTillBallDrops(x),y_correct))

Y = 2015 M = 12 D = 30 H = 0 MN = 0 S = 0 junk = 2 Y = 0 M = 1 D = 2 H = 0 MN = 0 S = 0 ans = 002 days, 00 hours, 00 minutes, 00 seconds to go.

4   Pass
%% x = '2015-05-26'; y_correct = '220 days, 00 hours, 00 minutes, 00 seconds to go.'; assert(isequal(CantWaitTillBallDrops(x),y_correct))

Y = 2015 M = 5 D = 26 H = 0 MN = 0 S = 0 junk = 220 Y = 0 M = 8 D = 7 H = 0 MN = 0 S = 0 ans = 220 days, 00 hours, 00 minutes, 00 seconds to go.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!