note 38608 added to function.date

From: Date: Tue, 30 Dec 2003 03:10:47 +0000
Subject: note 38608 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-62661@lists.php.net to get a copy of this message
The examples here have an insidious problem. The following code assumes that date() always return values of the same date. But the current time is always changing: mktime(0,0,0,date("m"),date("d"),date("Y")) It is wrong when the three calls to date() straddle midnight at the end of a month. For proper date calculations you should get all the values of the current date in one function call to date() or time(). --jeff++ ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38608 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38608&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38608&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62661) next »