RE: [PHP] Working with dates in PHP
| From: | David Freeman | Date: | Fri, 11 Oct 2002 07:09:58 +0000 |
| Subject: | RE: [PHP] Working with dates in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119612@lists.php.net to get a copy of this message | ||
> I am at my wits end at the moment. I am pulling a
> datetimestamp out of a database and attempting to
> get the year month and day out of it.
Do it in your sql query. Check out chapter 6 of the MySQL manual for
ways to manipulate dates.
Eg. $query = "select DATE_FORMAT(DTStamp, '%e %b %y') AS DispDate WHERE
some=condition";
Will get you a date as day month year. There's heaps of options and you
should probably read up on them.
CYA, Dave