Issues

ZF-11733: Zend_Date::setOptions(array('format_type' => 'php')) breaking Zend_Date

Issue Type: Bug Created: 2011-09-12T04:11:08.000+0000 Last Updated: 2012-03-12T00:50:49.000+0000 Status: Closed Fix version(s): Reporter: Cameron Zemek (grom358) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Date

Related issues: - ZF-12095

Attachments:

Description

'php')); $d = new Zend\_Date(); $d->set('00:00:00', Zend\_Date::TIMES); // This is throwing an exception /\* Fatal error: Uncaught exception 'Zend\_Locale\_Exception' with message 'Unknown date format, neither date nor time in 'wwww' found' in /opt/php/ZendFramework-1.11.10/library/Zend/Date.php on line 2665 Zend\_Locale\_Exception: Unknown date format, neither date nor time in 'wwww' found in /opt/php/ZendFramework-1.11.10/library/Zend/Locale/Format.php on line 849 Call Stack: 0.0001 329124 1. {main}() /var/www/bug.php:0 0.0235 3416460 2. Zend\_Date->set() /var/www/bug.php:6 0.0236 3416724 3. Zend\_Date->\_calculate() /opt/php/ZendFramework-1.11.10/library/Zend/Date.php:1078 0.0243 3417796 4. Zend\_Locale\_Format::getDate() /opt/php/ZendFramework-1.11.10/library/Zend/Date.php:2629 0.0243 3418604 5. Zend\_Locale\_Format::\_parseDate() /opt/php/ZendFramework-1.11.10/library/Zend/Locale/Format.php:1118 Zend\_Date\_Exception: Unknown date format, neither date nor time in 'wwww' found in /opt/php/ZendFramework-1.11.10/library/Zend/Date.php on line 2665 Call Stack: 0.0001 329124 1. {main}() /var/www/bug.php:0 0.0235 3416460 2. Zend\_Date->set() /var/www/bug.php:6 0.0236 3416724 3. Zend\_Date->\_calculate() /opt/php/ZendFramework-1.11.10/library/Zend/Date.php:1078 \*/ ### Comments Posted by Adam Lundrigan (adamlundrigan) on 2012-03-06T16:34:39.000+0000 The majority (all?) of the built-in constants (like Zend\_Date::TIMES) only work with format\_type = iso. The purpose of format\_type => php is to allow you to use the datetime specifiers defined by the PHP [date](http://php.net/date) function. As a general rule, you can't reliably mix-and-match format specifiers between the different format\_type options. Please read this section of the manual for more information: [http://framework.zend.com/manual/en/…](http://framework.zend.com/manual/en/zend.date.overview.html#zend.date.options.formattype)

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts