note 15419 deleted from function.mktime by hholzgra

From: Date: Sun, 14 Apr 2002 22:08:25 +0000
Subject: note 15419 deleted from function.mktime by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29324@lists.php.net to get a copy of this message
Do not add leading zeroes to your values calling mktime() or gmmktime()! This could cause a wrong calculation (but not in every case - that's the tricky thing).<br> e.g. try out this code:<br> echo "calc with zero: ".mktime(00,00,00,09,04,2001)."\n"; echo "calc w/o zero: ".mktime(0,0,0,9,4,2001)."\n";<br> The result will be (which should be the same values but only the second one is correct):<br> calc with zero: 975884400 calc w/o zero: 999554400<br> Tested under PHP 4.0.6 on Win32 and under PHP 4.0.6 on Linux system (kernel 2.2.20).

« previous php.notes (#29324) next »