Ok, never understood how this worked, so a good explanation would be nice :-)

in my form, my date is: dd-mm-yyyy

$date[] = self::createElement('text', 'mydate')
        ->addValidator('Date', 'YYYY-MM-DD', array('DD-MM-YYYY'))

but for inputting it in my mysql the format needs to be yyyy-mm-dd.

What I do know to convert:

$formData = $this->_request->getPost();
$date        = explode("-",formData );
$formData['mydate'] = $date[2]."-".$date[1]."-".$date[0];


1. Is there a way to do this e.g. with Zend Date?
2. I do this in every controller. Is there a way to write a filter or
something that could handle this? Or maybe extend my Zend_Form?

-----
visit my website at  http://www.phpscriptor.com/ http://www.phpscriptor.com/ 
-- 
View this message in context: 
http://www.nabble.com/Form-date-and-mysql-tp22988684p22988684.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to