the_time()显示当前文章/页面的发布时间

目录

描述

Displays the time of the current post. To return the time of a post, use get_the_time(). This tag must be used within The Loop.

the_time() 描述

用法

 <?php the_time$d ); ?> 

the_time() 用法

参数

$d

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

默认值: None

the_time() 参数

示例

Default Usage

Displays the time using your WordPress defaults.

Time as AM/PM VS. 24H format

Displays the time using the format parameter string 'g:i a' (ex: 10:36 pm).

Displays the time using the 24 hours format parameter string 'G:i' (ex: 17:52).

Date as Month Day, Year

Displays the time in the date format 'F j, Y' (ex: December 2, 2004), which could be used to replace the tag the_date().

Date and Time

Displays the date and time.

Posted: July 17, 2007 at 7:19 am

the_time() 示例

相关