On Tue, Jan 21, 2003 at 02:36:15PM -0600, Dave Rolsky wrote: > On Tue, 21 Jan 2003, Tim Bunce wrote: > > > > FWIW *if* there should be a default date format for DBI, *please* ... > > > > *If* there should be a default date format for DBI it will be the ISO > > standard used by ODBC. > > I think there may be some confusion here. > > What _I_ had envisioned, if this were to come to pass, was not a standard > format (like ISO), but a standard object. So we'd have something like > this: > > $sth->bind_params(1, $datetime_object, SQL_DATE); > > Given a standard API, the driver would be able to call methods on this > object to get a string in the format it needs, which will vary from DBMS > to DBMS, most likely.
I'm not keen on having the DBI or drivers call methods when passed blessed references. I'd say the object should stringify to the standard ISO format or the uer calls the method explicitly: $sth->bind_params(1, $datetime_object->iso, SQL_DATE); Tim.