Date problem: data is current as of yesterday
| From: | Karen Resplendo | Date: | Fri, 02 Jul 2004 18:36:19 +0000 |
| Subject: | Date problem: data is current as of yesterday | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35106@lists.php.net to get a copy of this message | ||
The database queries all the sources at night after everyone has gone home. That means the data was
current as of yesterday. This little snippet below returns yesterday's date, except that the
first day of the month returns "0" for the day. Now, I know why this is happening, but I
can't find out how to fix it (in VBA or SQL Server I would just say, "date()-1":
$today = getdate();
$month = $today['month'] ;
$mday = $today['mday'] -1;
$year = $today['year'];
echo "Data is current as of <b>$month $mday, $year</b><br>";
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!