php中localtime与getdate的区别?
程序员文章站
2022-04-05 12:06:25
...
刚刚看文档,感觉这两个函数很相似,都是根据时间戳返回日期,时间等信息的数组,而且从返回的信息上来看getdate完全可以取代localtime,那么请问localtime存在的意义是什么呢?
回复内容:
刚刚看文档,感觉这两个函数很相似,都是根据时间戳返回日期,时间等信息的数组,而且从返回的信息上来看getdate完全可以取代localtime,那么请问localtime存在的意义是什么呢?
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
)
下一篇: ps蒙版怎么变成黑色