Hi Ron, we are finally looking at this issue. One new component we are developing for Zend Framework is called Zend_Date. This is a very sophisticated class for handling dates, with special attention to locale support.
What I would suggest is that each Zend_Db_Adapter class have a method to convert an object of Zend_Date into a string in the format appropriate for a date literal in the respective RDBMS back-end. For example, MySQL prefers 'YYYY-MM-DD HH:MM:SS' format.
This could either by done by the user using a static method:
$db->query('INSERT INTO myTable (dateColumn) VALUES (?)',
Zend_Db_Adapter_Pdo_Mysql::dateString( $myZendDateObject ) );
Or else it could be done "automatically", such that the query() method discovers if any of its bound parameters are instances of the Zend_Date class, and converts them to the correct string format internally before sending them to the RDBMS back-end.
$db->query('INSERT INTO myTable (dateColumn) VALUES (?)',
$myZendDateObject );
Both solution can coexist. You can supply either a Zend_Date or a string for a bound parameter for a date column. So if you don't like the way Zend_Db converts the Zend_Date object to a string, you can do it yourself and pass a string formatted how you like.
What Zend_Db cannot easily do is to enforce that Zend_Date objects are used only in contexts for SQL date columns. To do this, Zend_Db would need to be able to evaluate the semantics of the SQL statements, and this is beyond the scope of Zend_Db.
Zend_Db can convert Zend_Date objects to a string representation, but it must assume that the user has used that value in an appropriate context.
Changing fix version to 0.8.0.