Nigel Garvey wrote on Thu, 22 May 2003 01:52:39 +0100:

>  on dateTommyydd(theDate)
>    set {day:dd, year:yyyy} to theDate
>    copy theDate to b
>    set b's month to January
>    set mm to (theDate - b + 3944592) div 2629728
>    return text 2 thru -1 of ((100000000 + mm * 1000000 + dd * 10000 +
>yyyy) as string)
>  end dateTommyydd

Sorry about the handler name. Late-night brain seizure.

The addition of 100000000 in the return line is to generate a leading
zero when mm is less than 10. This step can be optimised out by changing
one of the numbers in the previous line.

  on dateTommddyyyy(theDate)
    set {day:dd, year:yyyy} to theDate
    copy theDate to b
    set b's month to January
    set mmPlus100 to (theDate - b + 266917392) div 2629728
    return text 2 thru 9 of ((mmPlus100 * 1000000 + dd * 10000 + yyyy) as
string)
  end dateTommddyyyy

This can be done using no variables other than the parameter, but the
above's more efficient. :-)

NG