Hi,
I am trying to solve this below question.I have looked at the JDate and GDate code.
java DaysOld 2000-2-2
You were born on February 2, 2000
Today is April 19, 2013
You are now 4825 days old.
And below is the algorithm that I came up.
so from 2000 to 2013 i find the leap years
2004, 2008, 2012
see if it is leap year or not
for leap years count sum=sum+366 days
else sum=sum+ 365 days
finding days in month from feb 2nd 26+31 feb+mar
and in 4th month i have to add +19 and that gives me 4825.
Is this how I should approach the problem?
Initially I have copied the
String argument into
.
After this do I have any function which can directly find the difference between dates or
do I have to implement the above algorithm that I have written?
Could you suggest which direction I should be going?