php-db | 2004071
Date: 07/02/04
- Next message: jeffrey_n_Dyke <email protected>: "Re: [PHP-DB] Date problem: data is current as of yesterday"
- Previous message: Karen Resplendo: "[PHP-DB] Date problem: data is current as of yesterday"
- In reply to: Karen Resplendo: "[PHP-DB] Date problem: data is current as of yesterday"
- Next in thread: jeffrey_n_Dyke <email protected>: "Re: [PHP-DB] Date problem: data is current as of yesterday"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Use strtotime() instead..
http://us2.php.net/manual/en/function.strtotime.php
Regards,
Neal Carmine
Nine Systems Corporation
-----Original Message-----
From: Karen Resplendo [mailto:karenresplendo <email protected>]
Sent: Friday, July 02, 2004 12:36 PM
To: php-db <email protected>
Subject: [PHP-DB] Date problem: data is current as of yesterday
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!
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: jeffrey_n_Dyke <email protected>: "Re: [PHP-DB] Date problem: data is current as of yesterday"
- Previous message: Karen Resplendo: "[PHP-DB] Date problem: data is current as of yesterday"
- In reply to: Karen Resplendo: "[PHP-DB] Date problem: data is current as of yesterday"
- Next in thread: jeffrey_n_Dyke <email protected>: "Re: [PHP-DB] Date problem: data is current as of yesterday"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

