ZF-12010: Zend_Date isLater doesn't work properly when using yyyy-MM-dd as $part

Issue Type: Bug Created: 2012-01-18T13:56:01.000+0000 Last Updated: 2012-02-26T00:36:17.000+0000 Status: Closed Fix version(s): Reporter: Adri (adri11) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Date

  • islater
  • zend_date

Related issues: Attachments:


If i do this:

$a=new Zend_Date(); $b=clone $a;

and this: $a->isLater($b,'yyyy-MM-dd')

I should get a false value, insted I get a TRUE value.

If i use: $a->isLater($b,Zend_Date::DATES)

I get the correct value (false).


Posted by Sebastian Gro├če (sebastian.grosse) on 2012-02-21T08:22:42.000+0000

I think this is correct behavier.

In the comparison from date $b only year, month and days are considered (so hours, minutes, seconds are 0) and so it is before date $a where hours, minutes and seconds or at least one of it are greater than 0, so $a is later than $b and the comparison is correct.

Posted by Adam Lundrigan (adamlundrigan) on 2012-02-26T00:36:17.000+0000

You have to specify one of the recognized date constants as the second argument to isLater. More information is available in the Comparing Dates section of the manual.

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.