Given an integer n(in seconds).Convert it into days, hours, minutes and seconds.
Input : 369121517 Output : 4272 days 5 hours 45 minutes 17 seconds Input : 129600 Output : 1 days 12 hours 0 minutes 0 seconds
Number of days = ⌊ n / (24 * 3600) ⌋
Number of Hours = ⌊ (n % (24 * 3600)) / 3600 ⌋
Number of Minutes = ⌊ (n % (24 * 3600 * 3600)) / 60 ⌋
Number of Seconds = ⌊ (n % (24 * 3600 * 3600 * 60)) / 60 ⌋
1 days 12 hours 0 minutes 0 seconds
- Program for converting hours into minutes and seconds
- Python program to convert seconds into hours, minutes and seconds
- Count of a, b & c after n seconds for given reproduction rate
- Program to convert given number of days in terms of Years, Weeks and Days
- Total money to be paid after traveling the given number of hours
- PHP | Converting string to Date and DateTime
- Find number of days between two given dates
- PHP | Number of week days between two dates
- Python program to find number of days between two given dates
- Program to find the time after K minutes from given time
- Date after adding given number of days to the given date
- C/C++ For loop with Examples
- Program to find the last digit of X in base Y
- 5 Best Programming Languages For Newbies
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nitin mittal