I'm want to do a time convertion, and I' facing a precision problem.
I'have the time in minutes, and I want to change it into
Months, days, hours, and minutes formant
I've did a table in excel to test my logic with the following example:
I have 110008.128 minutes which should be:
(2 months) + (15 days) + (12 hours) + (30 minutes)
The logic that I'm using is:
- Convert the minutes to months :
year= minutes * (30.417*24*60)the30.417is for precision - get the decimal result in
yearand :days = (year-int(year)) * 30.417 - get the decimal result in
daysand :hours = (days-int(days)) * 24 - get the decimal result in
hoursand :minutes = (hours-int(hours)) * 60
The result is getting
2.5115735717965 Months, 15.560533 days, 13.453 hours 27.17 minutes
geting just the integer part 2 mon 15 days 13 hours and 27 minutes which is wrong.
Someone knows what is happening ?
Thanks a lot guys