1. Re: th-ing dates
On Tue, 27 Oct 1998 12:20:21 +0000, Carl R. White <C.R.White at SCM.BRAD.AC.UK>
wrote:
>On Tue, 27 Oct 1998, Andy Kurnia wrote:
>
>> I see some remainder() stuff trying to convert dates to its "standard"
>> (read: st-nd-rd) form... but then you will get 11st, 12nd, 13rd not 11th,
>> 12th, 13th!
>
>My web page (can) deal)s( with this. This is a Euphorization of the Korn
>Shell CGI script I wrote:
>
>constant--s
> Suf = {"st", "nd", "rd", "th"},
> Default = 4
>--end constants
>
>function suffix(integer a)
> integer last, rest
>
> last = remainder(a,10)
> rest = floor(a / 10)
>
> if remainder(rest,10) != 1 and
> last <= 1 and last >= 3 then
> return Suf[last]
> else
> return Suf[Default]
> end if
>end function
>
>--
He..he.. Thanks.
I should have reset my computer's date a few times to check
this. On the other hand, we got some good discussion going.
So maybe it's better sometimes not to test things very
carefully :)0
Regards,
Irv