note 105600 deleted from function.date by tularis

From: Date: Mon, 05 Sep 2011 12:59:26 +0000
Subject: note 105600 deleted from function.date by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182949@lists.php.net to get a copy of this message
Note Submitter: parazoom at gmail dot com ---- Be carfull after the day 28 of the month ! <?php $month = 1; $year = 2011; $day = 27; $mkdate = date("Y-m-d", mktime(0, 0, 0, $month+1, $day, 2011)); echo 'date : ' . $mkdate .'<br />';// TRUE the good date is : 2011-02-27 $day = 28; $mkdate = date("Y-m-d", mktime(0, 0, 0, $month+1, $day, 2011)); echo 'date : ' . $mkdate .'<br />';// TRUE the good date is : 2011-02-28 $day = 29; $mkdate = date("Y-m-d", mktime(0, 0, 0, $month+1, $day, 2011)); echo 'date : ' . $mkdate .'<br />';// FALSE the good date is : 2011-02-28 $day = 30; $mkdate = date("Y-m-d", mktime(0, 0, 0, $month+1, $day, 2011)); echo 'date : ' . $mkdate .'<br />';// FALSE the good date is : 2011-02-28 $day = 31; $mkdate = date("Y-m-d", mktime(0, 0, 0, $month+1, $day, 2011)); echo 'date : ' . $mkdate .'<br />';// FALSE the good date is : 2011-02-28 ?>

« previous php.notes (#182949) next »