WordPress: Function Reference/current time:修订间差异
来自站长百科
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
== 描述== | == 描述== | ||
返回当前时间或者时间标记。返回的时间会是选项网页中的erver time + the offset,而且这个时间与选项网页上显示的时间是等同的。 | 返回当前时间或者时间标记。返回的时间会是选项网页中的erver time + the offset,而且这个时间与选项网页上显示的时间是等同的。 | ||
== 用法 == | == 用法 == | ||
%%% <?php echo current_time($type, $gmt = 0); ?> %%% | %%% <?php echo current_time($type, $gmt = 0); ?> %%% | ||
== 例子 == | == 例子 == | ||
=== 用法=== | === 用法=== | ||
得到两种格式的当前系统时间。 | 得到两种格式的当前系统时间。 | ||
<pre> | <pre> | ||
第33行: | 第20行: | ||
Current timestamp: 1123238473</div> | Current timestamp: 1123238473</div> | ||
== 参数 == | == 参数 == | ||
{{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>}} |
2008年7月28日 (一) 10:09的最新版本
描述[ ]
返回当前时间或者时间标记。返回的时间会是选项网页中的erver time + the offset,而且这个时间与选项网页上显示的时间是等同的。
用法[ ]
%%% <?php echo current_time($type, $gmt = 0); ?> %%%
例子[ ]
用法[ ]
得到两种格式的当前系统时间。
<?php echo('Current time: ' . current_time('mysql') . '<br />'); ?> <?php echo('Current timestamp: ' . current_time('timestamp')); ?>
Current time: 2005-08-05 10:41:13
Current timestamp: 1123238473
Current timestamp: 1123238473