数字化技能提升教程,数字化时代生存宝典

数字化百科 / 产品文档 / WordPress:Function Reference/current time

WordPress:Function Reference/current time

查看全部产品文档命名空间:WordPress

描述

返回当前时间或者时间标记。返回的时间会是选项网页中的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

参数