'news_from_date' in Magento

magento, php

Solution

Proper SQL DateTime format

Magento SQL stores dates in this format:

`yyyy-mm-dd hh:mm:ss`

`date("Y-m-d H:i:s");`

So instead of:

`'news_from_date' => "00/00/00 00:00:00";`

`'news_from_date' => date("d/m/Y h:i:s");`

Use:

`'news_from_date' => "0000-00-00 00:00:00";`

`'news_from_date' => date("Y-m-d H:i:s");`

Problem

I am using the Magento API to make a product "New" with the following ``` 'news_from_date' => date("d/m/Y h:i:s"); ``` using `catalog_product.update` This works perfectly fine and shows the item as "New" However, I am now trying to make an item previously marked as "New" not to be new. I thought I could do this again with catalog_product.update and just making ``` 'news_from_date' => null; ``` But this only sets the date to - 30/11/1999 which obviously keeps the item as "New" Can someone point me in the right direction? Edit I have also tried the following with no joy - ``` 'news_from_date' => "00/00/00 00:00:00"; ``` Thanks

Original source