WordPress: Function Reference/current time:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == 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 th...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== 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.
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,而且这个时间与选项网页上显示的时间是等同的。


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


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


== Example ==
== Example ==
== 例子 ==


=== Usage ===
=== Usage ===
=== 用法===


Get the current system time in two formats.
Get the current system time in two formats.
得到两种格式的当前系统时间。
<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>


<pre>
<pre>
第22行: 第43行:


== Parameters ==
== 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|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>}}

2008年7月22日 (二) 11:55的版本

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,而且这个时间与选项网页上显示的时间是等同的。

Usage

用法

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

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

Example

例子

Usage

用法

Get the current system time in two formats. 得到两种格式的当前系统时间。

<?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


<?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

Parameters

参数