编辑“WordPress:Template Tags/the time

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第1行: 第1行:
== Description ==
== 描述 ==
== 描述 ==
Displays the time of the current post.  This tag must be used within [[WordPress:The Loop]].


显示当前文章的发表时间。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。
显示当前文章的发表时间。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。
== Usage ==
%%% <?php the_time('d'); ?> %%%


== 用法 ==
== 用法 ==


%%% <?php the_time('d'); ?> %%%
%%% <?php the_时间('d'); ?> %%%
 
== Examples ==
 
=== Default Usage ===


== 例子 ==
== 例子 ==
第11行: 第23行:
=== 默认用法 ===
=== 默认用法 ===


Displays the time using your WordPress defaults.


使用WordPress默认设置,显示时间。
使用WordPress默认设置,显示时间。


  &lt;p&gt;Time posted: <?php the_time(); ?>&lt;/p&gt;
  &lt;p&gt;Time posted: <?php the_time(); ?>&lt;/p&gt;
&lt;p&gt;Time posted: <?php the_时间(); ?>&lt;/p&gt;
=== Time as AM/PM VS. 24H format===


===上午/下午标记的时间格式和24小时的时间格式===
===上午/下午标记的时间格式和24小时的时间格式===
Displays the time using the format parameter string <tt>'09:18 am'</tt> (ex: 10:36 pm).


使用格式参数string <tt>'上午09:18 '</tt> (例如: 下午10:36)显示时间。
使用格式参数string <tt>'上午09:18 '</tt> (例如: 下午10:36)显示时间。
第22行: 第42行:
  &lt;p&gt;Time posted: <?php the_time('g:i a'); ?>&lt;/p&gt;
  &lt;p&gt;Time posted: <?php the_time('g:i a'); ?>&lt;/p&gt;


--
&lt;p&gt;Time posted: <?php the_时间('g:i a'); ?>&lt;/p&gt;
--
Displays the time using the 24 hours format parameter string <tt>'G:i'</tt> (ex: 17:52).


使用24小时制时间格式参数string <tt>'G:i'</tt> (例如: 17:52)显示时间。
使用24小时制时间格式参数string <tt>'G:i'</tt> (例如: 17:52)显示时间。


  &lt;p&gt;Time posted: <?php the_time('G:i'); ?>&lt;/p&gt;
  &lt;p&gt;Time posted: <?php the_time('G:i'); ?>&lt;/p&gt;
&lt;p&gt;Time posted: <?php the_时间('G:i'); ?>&lt;/p&gt;
=== Date as Month Day, Year ===


===按年,月,日格式组合的日期 ===
===按年,月,日格式组合的日期 ===


以日期格式<tt>'F j, Y'</tt> (例如: 2004年12月2日),这个格式可以用来代替标签[[WordPress:Template Tags/the date|the_date()]]。
Displays the time in the date format <tt>'F j, Y'</tt> (ex: December 2, 2004), which could be used to replace the tag [[WordPress:Template Tags/the date|the_date()]].
 
以日期格式<tt>'F j, Y'</tt> (例如: 2004年12月2日),这个格式可以用来代替标签[[WordPress:Template Tags/the date|the_日期()]]。


  &lt;div&gt;<?php the_time('F j, Y'); ?>&lt;/div&gt;
  &lt;div&gt;<?php the_time('F j, Y'); ?>&lt;/div&gt;
&lt;div&gt;<?php the_时间('F j, Y'); ?>&lt;/div&gt;
=== Date and Time ===


=== 日期和时间 ===
=== 日期和时间 ===


Displays the date and time.
显示日期和时间。
显示日期和时间。
  &lt;p&gt;Posted: <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>&lt;/p&gt;
  &lt;p&gt;Posted: <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?>&lt;/p&gt;
&lt;p&gt;Posted: <?php the_时间('F j, Y'); ?> at <?php the_时间('g:i a'); ?>&lt;/p&gt;
<div style="border:1px solid blue; width:50%; padding:10px">Posted: July 17, 2007 at 7:19 am</div>


<div style="border:1px solid blue; width:50%; padding:10px">发表时间: 2007年7月17日上午 7:19 </div>
<div style="border:1px solid blue; width:50%; padding:10px">发表时间: 2007年7月17日上午 7:19 </div>
== Parameters ==


== 参数 ==
== 参数 ==
; d : (''string'') The format the time is to display in.  Defaults to the time format configured in your WordPress options.  See [[WordPress:Formatting Date and Time]].


; d : (''string'')显示时间的格式。默认为WordPress选项中设置的时间格式。请看看[[WordPress:Formatting Date and Time|日期和时间格式]]。
; d : (''string'')显示时间的格式。默认为WordPress选项中设置的时间格式。请看看[[WordPress:Formatting Date and Time|日期和时间格式]]。
== Related ==
{{Tag Date Tags}}
{{Tag Footer}}


== 相关的 ==
== 相关的 ==
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)