note 19327 deleted from function.mktime by hholzgra

From: Date: Sun, 14 Apr 2002 21:55:04 +0000
Subject: note 19327 deleted from function.mktime by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-29321@lists.php.net to get a copy of this message
Well It seems that the mktime function doesnt work correctly on Windows. Instead of using the PHP Date/Time functions, I advice you to use MySQL one. For example, if you want to know the days remaining until an user next birthday: $dateToday = mysql_result (mysql_query ("SELECT CURRENT_DATE()"), 0); $dateBirthday = ?; $nNbDayToday = mysql_result (mysql_query ("SELECT DAYOFYEAR('$dateToday')"), 0); $nNbDayBirthday = mysql_result (mysql_query ("SELECT DAYOFYEAR('$dateBirthday')"), 0); $delta = ($nNbDayBirthday - $nNbDayToday); // 0-30 days birthday warning if (($delta > 0) && ($delta < 30)) { echo "It's soon its birthday !"; }

« previous php.notes (#29321) next »