Open GoogleCodeExporter opened 8 years ago
There's an other problem related to this one: MySQL does not accept invalid
dates as input.
If there's a NULL valued cell in a db table, the zdmg setFunction() in the
model will bind "0000:00:00 00:00" invalid DATE(TIME) to the model via a
Zend_Date constructor (model.tpl:117).
But 0000 is not a valid date and that's why Zend will convert it to a valid
date (specifically to "00-1-11-30"). This date is valid, though MySQL knows
dates only from 1000. So from the view of MySQL this is also an invalid date.
Please, null out the column in the model if the cell in the database is also
NULL (or 0000:00:00). For DATE(TIME) you can do this with this simple check in
model.tpl:117:
if (! empty($data)) {
if (! $data instanceof Zend_Date) {
if (! Zend_Date::isDate($data)) {
return $this;
}
$data = new Zend_Date($data);
}
…
For further information, see: http://framework.zend.com/issues/browse/ZF-2213
Original comment by szots...@gmail.com
on 28 Aug 2012 at 1:56
I'll handle this one.
Original comment by hadfield...@gmail.com
on 17 Aug 2013 at 5:49
I've pushed up the expand-date-time-functionality branch which should have much
better date/time handling. If you're still using ZDMG, please give it a try.
Original comment by hadfield...@gmail.com
on 18 Aug 2013 at 6:00
Original issue reported on code.google.com by
szots...@gmail.com
on 14 Aug 2012 at 10:20