1

How accurate would it be to find elapsed time using two fractional Julian day numbers, subtracting them then converting it into Years, Months, Days,Hours, Minutes, Seconds. If it is how would I go about doing it taking into account leap years and such. Edit: I'm trying to do this in java

Quesurfin
  • 111
  • Differences are not a problem, apart from the occasional introduction of a leap second. – André Nicolas Nov 05 '12 at 20:33
  • If you want to use months as one of your output parts, you may have trouble finding an unambiguous value from onley the difference of the Julian dates: From January 31, 2013 to February 4, 2013 is "4 days"; from February 4 to March 4 is "1 month", hence we expect January 31, 2013 to March 4 to be "1 month 4 days", whereas the same timespan from March 1, 2013 to April 2 is just "1 month 1 day". – Hagen von Eitzen Nov 05 '12 at 20:59
  • can anyone give me the proper formula? – Quesurfin Nov 05 '12 at 21:53
  • im using

    if (m<=2.0){ y--; m += 12.0; } double a=floor(y/100.0); _jd = (365.25*(y+4716.0))+(30.6001*(m+1))+d+(2.0-a+floor(a/4.0))-1524.5; }

    – Quesurfin Nov 05 '12 at 21:55
  • Bump I was was wondering if this formula is accurate. floor() is a rounding function... – Quesurfin Nov 06 '12 at 15:36

0 Answers0