php中localtime与getdate的区别?
PHP中文网
PHP中文网 2017-04-11 10:38:38
0
1
363

刚刚看文档,感觉这两个函数很相似,都是根据时间戳返回日期,时间等信息的数组,而且从返回的信息上来看getdate完全可以取代localtime,那么请问localtime存在的意义是什么呢?

PHP中文网
PHP中文网

认证0级讲师

reply all (1)
巴扎黑

localtime获取的数组中,年是从 1900 开始的

 
Array ( [tm_sec] => 37 [tm_min] => 22 [tm_hour] => 3 [tm_mday] => 9 [tm_mon] => 9 [tm_year] => 116 [tm_wday] => 0 [tm_yday] => 282 [tm_isdst] => 0 ) Array ( [seconds] => 37 [minutes] => 22 [hours] => 3 [mday] => 9 [wday] => 0 [mon] => 10 [year] => 2016 [yday] => 282 [weekday] => Sunday [month] => October [0] => 1475983357 )
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!