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

查看所有标签

The Dream Machine

The Dream Machine

M. Mitchell Waldrop / Penguin Books / 2002-8 / USD 16.00

While most people may not be familiar with the name J. C. R. Licklider, he was the guiding spirit behind the greatest revolution of the modern era. At a time when most computers were big, ponderous ma......一起来看看 《The Dream Machine》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

随机密码生成器
随机密码生成器

多种字符组合密码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具