Answer the question
In order to leave comments, you need to log in
How to get the difference of two dates?
5. Write a function that returns, as a character string, the number of years, months, days, hours, minutes, and seconds between the given dates. Leap years are taken into account.
For example, between the dates 02/01/2016 and 03/01/2016:
0 years, 1 month, 29 days, 696 hours, 41760 minutes, 2505600 seconds
When displaying information, display text in accordance with the rules of the Russian language. For example:
For the number "1" - year, month, day, hour, minute, second
For the number "3" - year, month, day, hour, minute, second
For the number "5" - years, months, days, hours, minutes, seconds
I can calculate the difference itself, but I don’t know how to insert the words “year, month, etc.” with the correct ending, tell me))))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question