As @william-oakley suggested and unless you need to stick to the lastRunTime approach for some reason, it would be more robust to read and log which orders have been exported rather than rely on the time. public function ExportSales() { //A collection of orders $orderCollection = Mage::getModel('sales/order')->getCollection(); $orderCollection ->addAttributeToFilter('status', array('in' => array('pending', 'complete'))) // Filter by Non exported ->addFieldToFilter('exported', array('eq' => '0')); } Of course for this to work you will need to create the `exported` field in the database and update it as exported when you finish exporting the order.