O.P. Formula to calculate days lived?
I'm coding this program in Java and I absolutely need a formula to be able to calculte the numbers of days lived.
I searched the net, I couldn't find much.
What I came up with is this :
[ {365 * (currentyear -yearborn)} + {(currentyear -yearborn) / 4} ] - [(daysofyearthatpassed*) + (dayborn)] + [(daysofyearthatpassed*)+(currentday)]
daysofyearthatpassed* : depending on which month and if the year has 366 or 365 days, I calculated an amount that I just add to the day.
As you can see this isn't working.. So if you guys find a better way or can actually correct this, please don't be shy to do so.
|