编辑“WordPress:Function Reference/current time

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

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

最后版本 您的文本
第1行: 第1行:
== Description ==
== 描述==
== 描述==
Returns the current time or timestamp. The time returned will be the server time + the offset in the options page, and it will be equivalent to the time displayed on the options page itself.


返回当前时间或者时间标记。返回的时间会是选项网页中的erver time + the offset,而且这个时间与选项网页上显示的时间是等同的。
返回当前时间或者时间标记。返回的时间会是选项网页中的erver time + the offset,而且这个时间与选项网页上显示的时间是等同的。
== Usage ==


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


%%% <?php echo current_time($type, $gmt = 0); ?> %%%
%%% <?php echo current_time($type, $gmt = 0); ?> %%%
%%% <?php echo current_time($type, $gmt = 0); ?> %%%
== Example ==


== 例子 ==
== 例子 ==
=== Usage ===


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


Get the current system time in two formats.
得到两种格式的当前系统时间。
得到两种格式的当前系统时间。
<pre>
<pre>
第20行: 第33行:
Current timestamp: 1123238473</div>
Current timestamp: 1123238473</div>


<pre>
<?php echo('Current time: ' . current_time('mysql') . '<br />'); ?>
<?php echo('Current timestamp: ' . current_time('timestamp')); ?>
</pre>
<div style="border:1px solid blue; width:50%; padding:10px">Current time: 2005-08-05 10:41:13<br />
Current timestamp: 1123238473</div>
== Parameters ==
== 参数 ==
== 参数 ==
{{Parameter|$type|string|The time format to return. Possible values:<ul><li><tt>mysql</tt></li><li><tt>timestamp</tt></li></ul>}}


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

本页使用的模板: