On 3/30/07, Sietse Wijnker <[EMAIL PROTECTED]> wrote:

> Hmm, the start date isn't relevant.

I think start date is relevant.

1. How many months and days are there in 59 days if you start on January 1st?

2. How about 62 days?

3. What if you start on January 15th?

4. June 1st? June 15th? June 30th?

"It depends."

A1: Two months, or one month and 29 days, depending on leap year.

A2. Two months three days or two months, two days, ditto.

3. Same problem, leap day.

4. A different problem: depending on where you start in the month and
how long the months are you traverse, you could end up with a
different number of months and a different remainder of days.

The question of "How many years, months and days in 500 days" has no
answer without a base date. You can't even answer "years and days"
unless you can tell me how many days there are in "a" year.

The quick answer: use 365.25 for years and 30.4375 for days and return
the answer as "approximate"

#DEFINE DaysInYear 365.25
#DEFINE DaysInMonth 30.4275

* Given d=397, the number of days:

nYears = INT(d/DaysInYear)
nMonths = INT((d-nYears*DaysInYear)/DaysInMonth)
nDays = INT(d-(nYears*DaysInYear)-(nMonths*DaysInMonth))



-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to