Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date 如何在Magento获得订单时间?_Date_Pdf_Time_Magento 1.7_Invoice - Fatal编程技术网

Date 如何在Magento获得订单时间?

Date 如何在Magento获得订单时间?,date,pdf,time,magento-1.7,invoice,Date,Pdf,Time,Magento 1.7,Invoice,我正试图在Magento中重写我的PDF发票。如果没有订单日期,如何显示创建的时间 我正在准备/app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php中的insertOrder()类 $page->drawText(Mage::helper('core')->formatDate($order->getCreatedAtStoreDate(), 'short', false), 100, 100, 'UTF-8'); 仅结

我正试图在Magento中重写我的PDF发票。如果没有订单日期,如何显示创建的时间

我正在准备/app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php中的insertOrder()类

$page->drawText(Mage::helper('core')->formatDate($order->getCreatedAtStoreDate(), 'short', false), 100, 100, 'UTF-8');

仅结合日期显示时间。

仅显示时间部分的一种方法是:

$sTime = Mage::app()
    ->getLocale()
    ->date(strtotime($order->getCreatedAtStoreDate()), null, null, false)
    ->toString('H:m:s');

$page->drawText($sTime, 100, 100, 'UTF-8');
Magento的区域设置使用修改的
Zend_Date
类进行日期/时间操作

有关参数信息,请参见
app/code/core/Zend/Date.php的
toString()
方法