Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:56:17+00:00 2026-06-07T14:56:17+00:00

I am using Magento to get product date fields’ values. Then i decided to

  • 0

I am using Magento to get product date fields’ values. Then i decided to use Zend_Date to handle that values because Magento returns dates in different formats (depending on the locale set).

But what i faced stunned me for a while. I got three dates, 12 Jul 2012 (let’s call it today), 2 Mar 2012 and 2 Sep 2012. And checking if today is later than each of others returns true for both dates. E. g. today is later than 2nd of March (which is true) is later that 2nd of September (which stunned me).

Here’s the proof from PhpStorm’s watches:

enter image description here

I got the dates as follows:

$productData['news_from'] = Mage::app()->getLocale()->date($productData['news_from']);
$productData['news_to'] = Mage::app()->getLocale()->date($productData['news_to']);

$_currentDate = Mage::app()->getLocale()->date();

What am i doing wrong???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:56:19+00:00Added an answer on June 7, 2026 at 2:56 pm

    Could it be that your dates aren’t parsed correctly from strings you receive from Mage? They seem to be not standard… try checking the UNIX timestamp for every value and see if its values tally with your source string dates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just discovered on my site using magento 1.3.2.2 that on a bundled product,
How to get attributes and its values using single Collection in Magento? Right now
I am using Magento 1.4.0.1. I am trying to get my product listing pages
I am using Magento community version 1.5.1.0. I need to get a product have
I'm setting up Magento installation (using bitnami magento image 1.7.0) and can't get PayPal
I'm using Magento Community Edition ver. 1.6.2.0. I’m trying to add a Simple product
I am using Magento ver1.6.1. I need to get the root category of a
In Magento I'm using the following code to get a bestsellers data collection: Model
Im using default profile for magento product export when i click the run profile
Is there any function in magento to get the category url by using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.