tags:

views:

201

answers:

2

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?

A: 

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()

Savageman
php.net says: Note: As of PHP 5.1.0, this parameter became deprecated. As a result, the new timezone handling features should be used instead.
Haroldo
Yeah right, I just saw that afterwards.
Savageman
+1  A: 

~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

ZombieSheep
thanks, solved with this from the php site:$today = mktime(12, 0, 0, date("m"), date("d"), date("Y"));
Haroldo