「ver4/関数リファレンス/getContentCreatedDate」の版間の差分
提供: baserCMS公式ガイド
(2人の利用者による、間の5版が非表示) | |||
行1: | 行1: | ||
− | |||
## 説明 | ## 説明 | ||
− | + | コンテンツ作成日を取得する。 | |
## 使い方 | ## 使い方 | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
− | <?php $this->BcBaser->getContentCreatedDate( | + | <?php $this->BcBaser->getContentCreatedDate($format); ?> |
</syntaxhighlight> | </syntaxhighlight> | ||
行15: | 行14: | ||
## 戻り値 | ## 戻り値 | ||
− | + | (null | string) | |
− | : コンテンツ作成日 | + | : null または コンテンツ作成日 |
行43: | 行42: | ||
Oct. 16. Tue | Oct. 16. Tue | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
## 変更履歴 | ## 変更履歴 | ||
− | + | - [https://github.com/baserproject/basercms/blob/98c5d24daca66c38dfbd2b67c0ac85a3b5902b26/lib/Baser/View/Helper/BcBaserHelper.php#L2622 4.4.0] | |
− | # | + | |
− | + | ||
− | + | ||
##類似の関数 | ##類似の関数 | ||
− | + | - [getContentModifiedDate](/ver4/関数リファレンス/getContentModifiedDate) - コンテンツ更新日を取得 | |
− | + | - [getUpdateInfo](/ver4/関数リファレンス/getUpdateInfo) - 更新情報を取得する | |
− | [ | + | - [updateInfo](/ver4/関数リファレンス/updateInfo) - 更新情報を出力する |
2020年10月20日 (火) 15:52時点における最新版
説明
コンテンツ作成日を取得する。
使い方
<?php $this->BcBaser->getContentCreatedDate($format); ?>
パラメータ
- (string)$format
- フォーマット
- - 初期値: 'Y/m/d H:i'
戻り値
- (null | string)
- null または コンテンツ作成日
用例
基本
コンテンツ作成日を取得し、echoで出力する。
コード
<?php echo $this->BcBaser->getContentCreatedDate(); ?>
出力
2018/10/16 23:30
応用
コンテンツ作成日を指定した書式で取得し、echoで出力する。
コード
<?php echo $this->BcBaser->getContentCreatedDate('M. j. D'); ?>
出力
Oct. 16. Tue
変更履歴
類似の関数
- getContentModifiedDate - コンテンツ更新日を取得
- getUpdateInfo - 更新情報を取得する
- updateInfo - 更新情報を出力する