私はmagentoでフロントエンドで間違ったブログ掲載日を取得しています。間違ったブログ掲載日Magentoに表示
これは投稿のphtmlファイルのコードです。以下のような
$formatType = Mage::getStoreConfig(NeoTheme_Blog_Helper_Data::XPATH_CONFIG_DATETIME_FORMAT_TYPE);
$format = ($formatType != 'custom')?
Mage::app()->getLocale()->getDateTimeFormat($formatType):
Mage::getStoreConfig(NeoTheme_Blog_Helper_Data::XPATH_CONFIG_DATETIME_CUSTOM_FORMAT);
とhtml以下でその表示日 -
<span class="post-time">
<?php //echo $this->__('Posted On: '); ?>
<?php $date = ($this->getPost()->getPostDate() != NULL)? $this->getPost()->getPostDate() : $this->getPost()->getCreatedAt(); ?>
<?php echo Mage::app()->getLocale()->date($date)->toString($format); ?>
<?php // $timestamp = (int) Mage::app()->getLocale()->date($date)->getTimestamp() ;?>
<?php // echo date('d D', $timestamp)?><?php // echo date('M', $timestamp)?>
</span>
これは私のデータベース構造
+--------------------+----------------------+------+-----+---------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+----------------------+------+-----+---------------------+-----------------------------+
| entity_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| created_at | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| updated_at | timestamp | NO | | 0000-00-00 00:00:00 | |
| status | smallint(5) unsigned | NO | | 1 | |
| title | text | NO | | NULL | |
| author | text | NO | | NULL | |
| post_date | timestamp | NO | | 0000-00-00 00:00:00 | |
| summary | text | NO | | NULL | |
| content_html | text | NO | | NULL | |
| meta_description | text | YES | | NULL | |
| meta_title | text | YES | | NULL | |
| meta_keywords | text | YES | | NULL | |
| store_ids | text | NO | | NULL | |
| category_ids | text | NO | | NULL | |
| tag_ids | text | NO | | NULL | |
| cms_identifier | varchar(255) | YES | UNI | NULL | |
| customer_group_ids | text | YES | | NULL | |
| publish_date | timestamp | YES | | NULL | |
| use_summary | smallint(6) | YES | | 1 | |
| root_template | varchar(255) | YES | | NULL | |
| layout_update_xml | text | YES | | NULL | |
+--------------------+----------------------+------+-----+---------------------+-----------------------------+
で誰もがいただきました。このコードで間違って見つけるために私を助けてくださいすることができます。 データベースには、正しい日付が表示されます。
あなたは 'システム>設定>一般的なローカルoption'でlocaleオプションのための時間のためにあなたのローカル設定を確認しなかったことは、はい、それは私の理解ESTタイムゾーン(アメリカニューヨーク)のデータベース省 –
正しいですか'ESTタイムゾーン(アメリカ・ニューヨーク)'? –
あたりとして正しい –