Hallo,

I think it would be a good idea to have a module named
DateTime::Format::DBI that takes a DBI::db handle and returns an
appropriate DateTime::Format::* object (currently, we only have ::MySQL
and ::Pg).

  use DBI;
  use DateTime;
  use DateTime::Format::DBI;

  my $db = DBI->connect('dbi:...');
  my $db_parser = DateTime::Format::DBI->new($dbh);
  my $dt = DateTime->now();

  $db->do("UPDATE table SET dt=? WHERE foo='bar'",undef,
    $db_parser->format_datetime($dt);

I already have an implementation; but I'd like to hear comments first
instead of just releasing it.

Claus
-- 
http://www.faerber.muc.de

Reply via email to