Re: monthNumber (was: Create a folder with today's date...)
Re: monthNumber (was: Create a folder with today's date...)
- Subject: Re: monthNumber (was: Create a folder with today's date...)
- From: Nigel Garvey <email@hidden>
- Date: Thu, 14 Feb 2002 18:44:21 +0000
In his message of 14/2/2002 06:31 GMT, AppleScript Useer Lewis wrote:
>
At 15:59 +0000 12/02/02, Nigel Garvey wrote:
>
>John W Baxter wrote on Mon, 11 Feb 2002 19:52:49 -0800:
>
>
>
>>At 13:47 +0000 2/11/2002, Nigel Garvey wrote:
>
> >> return (dateObj - dateTemp + 3944592) div 2629728
>
> -- Extract the month number, using the Levy-Garvey equation
>
> -- N(m) = (d(m) - d(J) + 1.5L) div L
>
> -- The Levy number is the constant 2629728, defined as the number of
>
>seconds
>
> -- in one twelfth of one approximated solar year of 365.24 days
>
>
Is there any reason to use this specific number? Wouldn't the
>
formula work for any L such that 28 days < L < 30 days?
28 days itself is a bit low for this particular formula; the upper value
seems to be about 2748342 (31.809513888889 days). The possible range of L
probably depends on what fraction of it is added to the result of the
date subtraction. The range of the divisor for Richard Hartman's
variation is 28 days to 29.5 days.
I've never seen any comment from Emmanuel himself about how his method
works or why he chose that particular value. 365.24 days is a common
approximation for the length of a solar year. 2629728 is one twelfth of
that - that is, the approximate average length of a month over a period
of 400 years. It's thus a convenient divisor for that part of the
process. The preceding addition produces a value which is *somewhere* in
the overlap between the following calendar month and that same numbered
average month. Div-ing this by the length of an average month rounds down
to the number of this month.
The overlap between any calendar month and the same numbered average
month is at least a fortnight wide, so there are many values that could
be used for L. The trick is to limit the range to values that work for
every month of every year.
NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.