magento中把本地日期格式转换为国际日期格式
来源:互联网 发布:手机淘宝查看历史评价 编辑:程序博客网 时间:2024/04/30 14:40
来自magento的文件:
Mage::app()->getLocale()->date($creditMemo->getCreatedAt())->toString('YYYY-MM-dd');
或:
//$data为数组,date_expires为数组中要格式化日期的key
$this->_filterDates($data, array('date_expires'));
protected function _filterDates($array, $dateFields)
{
if (empty($dateFields)) {
return $array;
}
$filterInput = new Zend_Filter_LocalizedToNormalized(array(
'date_format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)
));
$filterInternal = new Zend_Filter_NormalizedToLocalized(array(
'date_format' => Varien_Date::DATE_INTERNAL_FORMAT
));
foreach ($dateFields as $dateField) {
if (array_key_exists($dateField, $array) && !empty($dateField)) {
$array[$dateField] = $filterInput->filter($array[$dateField]);
$array[$dateField] = $filterInternal->filter($array[$dateField]);
}
}
return $array;
}
- magento中把本地日期格式转换为国际日期格式
- 日期字符串转换为本地日期格式
- sql中把日期转换为某种格式然后和系统日期比较
- ArcMap中毫秒转换为日期格式
- js把时间戳转换为日期格式
- js把时间戳转换为普通日期格式
- 转换为英文日期格式
- 字符串转换为日期格式
- json格式日期转换为自定义格式
- excel日期格式转换为文本格式
- Json日期格式转换为正常格式
- js将long日期格式转换为标准日期格式
- js将long日期格式转换为标准日期格式
- js将long日期格式转换为标准日期格式
- js将long日期格式转换为标准日期格式
- js将long日期格式转换为标准日期格式
- js将long日期格式转换为标准日期格式
- js将long日期格式转换为标准日期格式
- 2011级河软csdn乐知学院咨询见面会
- vi常用操作
- joj 2536
- [struts-1.3.10] org.apache.struts包中的Globals类
- VC 画图原理分析(双缓冲) .
- magento中把本地日期格式转换为国际日期格式
- 0.VC(ui)-hook 换肤ERROR 汇总
- Pb12 + sqlanywhere11 应用程序打包指南
- Auctex 快捷键(两篇)
- C,C++代码中调用python脚本
- 详解Linux2.6内核中基于platform机制的驱动模型<强烈推荐,这是一篇学习驱动模型千年一遇的好文章>
- asm文件
- JavaScript字符串函数大全 已经字符串编码函数
- 打算在这里记录程序人生