Home > Backend Development > PHP Tutorial > php使用gettimeofday函数返回当前时间并存放在关联数组里_PHP

php使用gettimeofday函数返回当前时间并存放在关联数组里_PHP

WBOY
Release: 2016-06-01 11:06:22
Original
1051 people have browsed it

本文实例讲述了php使用gettimeofday函数返回当前时间并存放在关联数组里的方法。分享给大家供大家参考。具体分析如下:

英文官方描述如下:

Key Description
sec Seconds since midnight before January 1, 1970
usec  Microseconds since the sec value
minuteswest   
Local time zone difference from GMT, in minutes
dsttime  1 iff daylight savings time is in effect,
0 iff not.

<&#63;php
$Now = gettimeofday();
echo "As an associative array:\n";
foreach ($Now as $Key => $Value) {
 echo "$Key => $Value\n";
}
&#63;>
Copy after login

输出结果如下:

sec => 1261918156
usec => 724964
minuteswest => 0
dsttime => 0
Copy after login

希望本文所述对大家的php程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template