ZF-11939: Problem with Zend_Date Component

Issue Type: Bug Created: 2011-12-14T19:17:03.000+0000 Last Updated: 2012-02-26T07:50:20.000+0000 Status: Closed Fix version(s): Reporter: Douglas Dias (douglasdr3) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Date

Related issues: Attachments:


Grettings, I used to develop with CodeIgniter i'm studying Zend. I joined a team of programmers that is already using Zend, and my first job is correct a bug. The project uses Flex/AMF with Zend/php . I'm parsing a string date from flex to zend as following:

public function setRgExpedicao($value) { if ($value instanceof Zend_Date) { $value = $value->toString ( 'Y-m-d' ); } else if (null !== $value && false === is_string ( $value )) { throw new App_Exception ( 'Unsupported type or format of dataInicial' ); } $this->_set ( 'rgExpedicao', $value ); }

The Bug is, in some years like 1953 the date generated always has a day less, for exemple: Flex passes 1953-2-2 Zend_Date generates 1953-2-1. The bug is very curiuos, some years it generates the correct date like 2011-02-02. Can someone help me?


Posted by Ramon Henrique Ornelas (ramon) on 2011-12-28T00:01:26.000+0000

Per default Zend_Date utilize the format iso (but allow that be change to format php see the option format_type). This is your problem 'Y-m-d' change to yyyy-MM-dd.

Greetings Ramon

Have you found an issue?

See the Overview section for more details.


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

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