Recent Changes - Search:

Menu

Coranto Docs

Coranto Links

PmWiki Home

Dates formatted with st, nd, and rd

2005-06-15 by vanderveckette

Add the following code to the top of your news style:

<PerlCode>
if( $Day > 3 && $Day < 21 ) {
$Day = $Day.'th';
}elsif( $Day % 10 == 1 ) {
$Day = $Day.'st';
}elsif( $Day % 10 == 2 ) {
$Day = $Day.'nd';
}elsif( $Day % 10 == 3 ) {
$Day = $Day.'rd';
}else {
$Day = $Day.'th';
} </PerlCode>

Now just use <Field: Day>


Edit - History - Print - Recent Changes - Search
Page last modified on January 13, 2007, at 06:50 PM