I need to use a mysql function that takes as an input a big number that represents the number of minutes and convert it to the number of months, days, hours, minutes and seconds. Can some one help me to make it ?
Asked
Active
Viewed 119 times
0
-
The number of minutes... since when? Because "the number of minutes" is usually an integer value between 0 and 59. – The Impaler Dec 19 '18 at 21:00
-
Answers from this [post](https://stackoverflow.com/questions/41330789/mysql-convert-seconds-to-days-minutes-and-hours) would be helpful. – pagladashu Dec 19 '18 at 21:02
-
@TheImpaler 130 minutes is 2 hours, 10 minutes. – Barmar Dec 19 '18 at 21:25
-
This sounds like a grade school arithmetic problem. Have you forgotten all the math you learned as a child? – Barmar Dec 19 '18 at 21:26
-
It's just division and remainders. – Barmar Dec 19 '18 at 21:27
-
@Barmar Right, but what about months? 28, 29, 30, or 31 days? You need a starting moment in time. – The Impaler Dec 19 '18 at 21:28
-
@TheImpaler True, but that's a different problem from expecting mnutes to be less than 60. – Barmar Dec 19 '18 at 21:29
-
Consider handling this sort of stuff in application code – Strawberry Dec 19 '18 at 22:01
-
This really sounds like a basic arithmetics question, otherwise the problem needed a better definition - most likely the beginning or end of the interval become important, and defining how to handle leap seconds, is important, and defining if Timezones are relevant or not, etc. – theMage Dec 19 '18 at 22:35