Hi Paullo,
Try:
<?php
require 'Zend/Date.php';
Zend_Date::setOptions(array('format' => 'php'));
// changed 66 to 06, and no repetition of date tokens
$date_input = new Zend_Date('06/03/2007','d/m/y');
$month = $date_input->get(Zend_Date::MONTH);
$day = $date_input->get(Zend_Date::DAY);
$year = $date_input->get(Zend_Date::YEAR_8601);
echo $month.'-'.$day.'-'.$year;
The latest docs are here:
http://framework.zend.com/wiki/display/ZFDOCDEV/8.+Zend_Date
Note: We might rename the 'format' option above to 'date_format' very soon.
Cheers,
Gavin
P.S. .. and 5th: keep the docs in sync with the latest changes to SVN ;)
paullo wrote:
that's right it should be:
$date_input = new Zend_Date('66/03/2007','dd/mm/yyy');
$month = $date_input->get(Zend_Date::MONTH);
$day = $date_input->get(Zend_Date::DAY);
$year = $date_input->get(Zend_Date::YEAR_8601);
echo $month.'-'.$day.'-'.$year;
tnx