這篇文章主要介紹了php使用gettimeofday函數返回當前時間并存放在關聯數組里的方法,涉及php中gettimeofday函數的使用技巧,需要的朋友可以參考下
本文實例講述了php使用gettimeofday函數返回當前時間并存放在關聯數組里的方法。分享給大家供大家參考。具體分析如下:
英文官方描述如下:
KeyDescription
secSeconds 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";
- }
- ?>
輸出結果如下:
- sec => 1261918156
- usec => 724964
- minuteswest => 0
- dsttime => 0
希望本文所述對大家的php程序設計有所幫助。
新聞熱點
疑難解答