Search code examples
phpdstmktime

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


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?


Solution

  • ~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