开发者

is mktime() using date() daylight saving aware?

开发者 https://www.devze.com 2022-12-27 06:51 出处:网络
I\'ve read through a few questions about this here on s.o. and none seem to ask or answer the question very bluntly:

I've read through a few questions about this here on s.o. and none seem to ask or answer the question very bluntly:

$ts_today = mktime( 0, 0, 0, date('开发者_如何学Cm'), date('d'), date('Y') );

is this daylight saving aware?

if not, how do i make mktime() daylight saving aware?


~There's plenty of discussion of this on the PHP site itself, and some useful examples. In short, newer versions of PHP take account of DST as part of the timezone handling functionality


The last argument specifies whether it's DST or not. ;)

[edit] My bad, it's actually deprecated... It now depends on the timezone you specified with date_default_timezone_set()

0

精彩评论

暂无评论...
验证码 换一张
取 消