the_time – WordPress*リファレンス
現在のポストの時間を表示します。 Loopの中でこのタグを使用しなければなりません。
⇒Displays the time of the current post. This tag must be used within The Loop.
the_timeのテンプレートタグ使用方法
<?php the_time('d'); ?>
例
デフォルトの使い方
あなたのWordPressデフォルトを使用することで時間を表示します。
⇒Displays the time using your WordPress defaults.
<p>Time posted: <?php the_time(); ?></p>
Time as AM/PM VS. 24H format
形式パラメーターを使用すると’午前9時18分’(例えば、午後10時36分)が結ばれるとき、表示します。
⇒Displays the time using the format parameter string ‘09:18 am’ (ex: 10:36 pm).
<p>Time posted: <?php the_time('g:i a'); ?></p>
24時間の形式パラメーターを使用すると’G: i’(例えば、17:52)が結ばれるとき、表示します。
⇒Displays the time using the 24 hours format parameter string ‘G:i’ (ex: 17:52).
<p>Time posted: <?php the_time('G:i'); ?></p>
Date as Month Day, Year
表示日付の形式の時間’F j、Y’(例えば、2004年12月2日)。(_が()と日付を入れるタグを取り替えるのにその表示を使用することができました)。
⇒Displays the time in the date format ‘F j, Y’ (ex: December 2, 2004), which could be used to replace the tag the_date().
<div><?php the_time('F j, Y'); ?></div>
日時
日時を表示します。
<p>Posted: < ?php the_time('F j, Y'); ?> at < ?php the_time('g:i a'); ?></p>
⇒Displays the date and time.
Posted: July 17, 2007 at 7:19 am
the_timeのパラメーター
d
(string) 時間が表示することになっている形式。時間の形式へのデフォルトはあなたのWordPressでオプションを構成しました。 形式日時に遭遇してください。
⇒(string) The format the time is to display in. Defaults to the time format configured in your WordPress options. See Formatting Date and Time.
関連テンプレートタグ
the_date_xml, the_date, the_time, the_modified_date, |the_modified_time, get_the_time, single_month_title, get_calendar, the_weekday , the_weekday_date
関連記事







