php - Zend_Date comparison errors -


I am using Magento to get product date field value. Then I decided to use the Zend_Date to handle that value because Magenta gives dates in different formats (based on local set).

But for some time I was scared to me. I found three dates, 12 July 2012 (let's call it today), 2 March 2012 and 2 September 2012 . And checking that the return of each other later than today returns true for both codes. G. Today has been made after 2 March (which is true ) later on September 2 (which has left me stunned)

Here is evidence from PhpStorm watches:

Enter image details here

I have the following types of dates:

  $ productData ['news_from'] = Dana :: app () - & Gt; GetLocale () - & gt; Date ($ productData ['news_from']); $ ProductData ['news_to'] = Dana :: app () - & gt; GetLocale () - & gt; Date ($ product data ['news_to']); $ _currentDate = Mage :: app () - & gt; GetLocale () - & gt; date ();  

What am I doing ???

It may be that your dates are not parsed properly with the wires received from the wire ? They do not consider the standard ... Check the Unix timestamp for each value and see if its source matches it with your source string date.


Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -