문제

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('m'), 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()

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top