note 37413 deleted from function.date by pollita

From: Date: Fri, 21 Nov 2003 05:32:23 +0000
Subject: note 37413 deleted from function.date by pollita
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-60737@lists.php.net to get a copy of this message
Note Submitter: endofyourself@yahoo.com ---- I know this seems totally obvious, but for any newbies... If you are doing something along the lines of: <? echo date( "y" , mktime( 0 , 0 , 0 , 0 , 0 , 2003 )) ?> and it is returning "02" instead of "03", do this: <? echo date( "y" , mktime( 0 , 0 , 0 , (int)date( "n" ) , (int)date( "j" ) , 2003 )) ?> The reason for this is that the 0 day of the 0 month of the year 2003 is actually the last day of the last month of 2002 technically speaking.

« previous php.notes (#60737) next »