the_time

Sponsored Link

現在の記事の時間を表示します。このタグはループ内で使用する必要があります。

Sponsored Link

Displays the time of the current post. This tag must be used within The Loop.

the_timeのテンプレートタグ使用方法

<?php the_time( $d ); ?> 

the_timeのパラメーター

$d

(string) (optional) 時間を表示するフォーマットです。WordPressのオプションに設定されている時間フォーマットで表示します。書式設定日付と時刻を参照してください。

(string) (optional) The format the time is to display in. Defaults to the time format configured in your WordPress options. See Formatting Date and Time.

Default: None

デフォルトの使い方

WordPressのデフォルトを使用して時間を表示します。

Displays the time using your WordPress defaults.

Time posted:<?php the_time(); ?>

AM/PM 対 24時間フォーマット時間に表示方法

’09:18 am’(例:10:36 pm)のパラメータ文字列のフォーマットを使用して時間を表示します。

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>

年月日

‘F j, Y’(例:2004年12月2日)の日付フォーマットに時間を表示します。タグthe_date()に置き換えて使用する事ができました。

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>

日付と時間を表示する方法

日付と時間を表示します。

Displays the date and time.

<p>Posted:<?php the_time('F j, Y'); ?> at<?php the_time('g:i a'); ?></p>
Posted: July 17, 2007 at 7:19 am

関連テンプレートタグ

the_time, the_date, the_date_xml, the_modified_time, the_modified_date, the_modified_author, single_month_title, get_the_time, get_day_link, get_month_link, get_year_link, get_calendar

Sponsored Link