Hey everyone. I\'ve continuing to learn C++ and I\'ve been set the \'challenge\' of converting seconds to format as the Days,Minutes and Seconds.
For example: 316000
For example: 31600000 = 365 days, 46 minutes, 40 seconds.
Really?
$ bc
365*24*60*60 + 46*60 + 40
31538800
365*24*60*60 + 1066*60 + 40
31600000
Did you mean "convert the input into days, hours, minutes and seconds, and then discard the hours" or "convert the input into days, total minutes within a day (i.e. can be more than 60), and seconds"?
In the second case I think you should replace the instruction for minutes with
long minutes = input_seconds / secs_to_min % (mins_in_hour * hours_in_day);