Skip to main content.
home | support | download

Back to List Archive

Re: [Ignor Abuse] RE: Re: Date Format

From: Bill Moseley <moseley(at)>
Date: Mon Jan 12 2004 - 05:35:31 GMT
On Mon, Jan 12, 2004 at 01:00:30PM +1030, Ahmad, Zeeshan (FMC) wrote:
> Thanks. Works alright but returns a weird string when date was null.

That would be a bug.  One that we have been ignoring for a while.

>  Any workaround? Or some Perl hack is the way to go?

Nothing perfect.  I think Swish-e needs to be fixed.

Until then what I'd do is either:

a) make sure all my input data has dates, if that makes sense.

b) not use the fmt= field and if the date is not blank then parse the 
date that swish-e returns.

I guess I'd place this in the template module you are using.


    our @months  = qw/January February March April May June
                     July August September October November December/;

    # Reformat date string
    if ( $this_result->{swishlastmodifed} =~ /^(\d+)-(\d+)-(\d+)/ ) {
        my ( $year, $month, $day ) = ( $1, $2, $3 );
        $this_result->{swishlastmodifed} = "$day $months[$month-1] $year";

So is that a workaround or a hack?

Bill Moseley
Received on Mon Jan 12 05:35:38 2004