PHP gettimeofday() 函数

PHP 教程 · 2019-01-24 06:58:56

实例

返回当前时间:

<?php
// Print the array from gettimeofday()
print_r(gettimeofday());

// Print the float from gettimeofday()
echo gettimeofday(true);
?>

定义和用法

gettimeofday() 函数返回当前时间。

语法

gettimeofday(return_float);

参数 描述
return_float 可选。当设置为 TRUE 时,返回一个浮点数,而不是一个数组。默认是 FALSE。

技术细节

返回值: 默认返回一个关联数组,带有如下数组键名:R
  • [sec] - Unix 纪元以来的秒
  • [usec] - 微秒
  • [minuteswest] - 格林尼治以西的分
  • [dsttime] - 夏令时修正类型
如果 return_float 参数设置为 true,则返回一个浮点数。
PHP 版本: 4+
更新日志: PHP 5.1.0:新增了return_float 参数。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Struts 2 in Action

Struts 2 in Action

Don Brown、Chad Davis、Scott Stanlick / Manning Publications / 2008.3 / $44.99

The original Struts project revolutionized Java web development and its rapid adoption resulted in the thousands of Struts-based applications deployed worldwide. Keeping pace with new ideas and trends......一起来看看 《Struts 2 in Action》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具