in reply to Date conversion with Class::DBI

See the MySQL docs for the DATE_FORMAT() function. That gives a formatted date similar to POSIX::strftime. For example,

$sth = $dbh->prepare <<EOSQL; select DATE_FORMAT(The_Date_Col, '%d/%m/%Y') from the_table where Some_key = ? EOSQL

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Date conversion with Class::DBI
by bsb (Priest) on Jul 07, 2003 at 04:09 UTC
    I think this is too low level to use transparently via Class::DBI.
    I'm not too concerned about how to convert the dates but where.
    At what level of the Class::DBI architecture?

    If there's something in MySQL like Postgres' PGDATESTYLE="ISO,European" which made date handling transparent then that would do the trick. I couldn't find such an option so decided that automatic handling in Perl would be better than fiddling with SQL.