note 29135 added to function.time

From: Date: Tue, 04 Feb 2003 10:11:16 +0000
Subject: note 29135 added to function.time
Groups: php.notes 
Request: Send a blank email to php-notes+get-43368@lists.php.net to get a copy of this message
Do not forget the brackets at the end of the time() function. If you do, time returns 1.1.1970. This may cost you several hours of debugging - at least, it did me ... // this prints out "1969-12-31" instead of yesterday's date echo date("Y-m-d",(time-24*3600)); Stefan, http://www.certo-it.de -- http://www.php.net/manual/en/function.time.php http://master.php.net/manage/user-notes.php?action=edit+29135 http://master.php.net/manage/user-notes.php?action=delete+29135 http://master.php.net/manage/user-notes.php?action=reject+29135

« previous php.notes (#43368) next »