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:
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
Post a Comment