Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Convert # of days into Years Months Days 10.02.2016 19:36

My calculator will output the total number of days between to dates. How can I take that number and convert it to years months days for example 366 days would out put 1 year 0 months 1 day

Edited by phil_adler - 10.02.2016 19:36

Re: Convert # of days into Years Months Days 10.02.2016 19:41

Hi,
in fact there is no an exact solution to that problem, because not every year has same number of days and also months have different number of days, but you can get an approximation. Here you can find the code to get that solution:


http://www.php-forum.com/phpforum/viewtopic.php?t=9723


Hope this helps, regards
Moonsoft Team
www.moonsoft.es

Re: Convert # of days into Years Months Days 10.02.2016 20:09

I was afraid of that.

Re: Convert # of days into Years Months Days 10.02.2016 20:49

Hi,
yes, sorry, it's not a calculation that you can't do in php, is a calculation that you can't do in real life either...
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback