WordPress:Function Reference/current time

来自站长百科
Xxf3325讨论 | 贡献2008年7月19日 (六) 15:23的版本 (新页面: == 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...)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航、​ 搜索

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.

Usage

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

Parameters