I am trying to get all orders in magento, starting with a user-defined number entered.
$orders = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('created_at', array('from' => $userdate));
But he does not draw out the right orders. If I use today's date, it pulls half of the orders from yesterday and half from today.
After a bit of googling, it looks like the two dates are stored in Magento
$order->getCreatedAt()
UTC / GMT seems to be
$order->getCreatedAtStoreDate()
Gives the same time as in the interface (i.e. my local timezone).
If I'm right in what I found, then how can I add an AttributeToFilter using CreateAtStoreDate. I tried
('created_at_store_date', array('from' => $userdate)
source share