The example in this article describes how PHP uses the gettimeofday function to return the current time and stores it in an associative array. method. Share it with everyone for your reference. The specific analysis is as follows:
The official English description is as follows:
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.
<?php $Now = gettimeofday(); echo "As an associative array:\n"; foreach ($Now as $Key => $Value) { echo "$Key => $Value\n"; } ?>
The output results are as follows:
sec => 1261918156 usec => 724964 minuteswest => 0 dsttime => 0
I hope this article will be helpful to everyone’s PHP programming design.