Rubyists,

Given a table in a database defined by the following:

  create table test ( test DATE );

how can I insert the current time using Ruby/DBI?  Given a DBI::DatabaseHandler
"dbh" I'd expect that you can do the following:

  dbh.do "insert into test values (#{Time.now})"

That is, I expect the DBI library to convert a Time object into the database's
DATE data type.  It appears that this is not the case.  The above code causes
an error.

It doesn't convert the String '2002-10-04 18:30:00' into a DATE either.

For now, I am resorting to storing my date information as strings in the
database.  Does anyone know about the logistics of database-independent data
handling?

Cheers,
Gavin

--
Gavin Sinclair                                       Software Engineer
Sydney, Australia                            Soyabean Software Pty Ltd