On Wed, 4 Dec 2002 13:18:36 +0100, [EMAIL PROTECTED] wrote:
>@date = Today_and_Now();
>
>$ampm = 'AM';
>if ($date[3] >= 12)
>{
> $date[3] -= 12;
> $ampm = 'PM';
>}
This is an example of why AM/PM is deprecated. It's too easy to get wrong.
Hours are labeled: 12 AM, 1 through 11 AM, 12 PM, 1 through 11 PM,
so you need to add another line here:
$date[3] ||= 12;
>$date = sprintf(
> "%s %s %d %02d:%02d:%02d %s",
> Month_to_Text($date[1]),
> English_Ordinal($date[2]),
> $date[0],
> @date[3..5],
> $ampm);
>
>print "$date\n";