实例返回当前时间的 Unix 时间戳,并格式化为日期: <?php $t=time(); echo($t . "<br>"); echo(date("Y-m-d",$t)); ?> 定义和用法time() 函数返回自 Unix 纪元(January 1 1970 00:00:00 GMT)起的当前时间的秒数。 语法time(); 技术细节返回值: | 返回一个包含当前时间的 Unix 时间戳的整数。 |
---|
PHP 版本: | 4+ |
---|
下载地址: PHP strtotime() 函数 PHP timezone_abbreviations_list() 函数 |