Re: Date Formatting
| From: | Support @ Fourthrealm.com | Date: | Fri, 13 Dec 2002 18:16:12 +0000 |
| Subject: | Re: Date Formatting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128180@lists.php.net to get a copy of this message | ||
Use this:
function makedate($format, $indate)
{
$temp = explode("-", $indate);
$fulldate = mktime(0, 0, 0, $temp[1], $temp[2], $temp[0]);
$temp = date($format, $fulldate);
return ($temp);
}
and call it with this:
makedate("F d, Y", $row->datefield);
where $row->datefield is the variable of the date field in your table.
Peter
At 11:55 AM 12/13/2002 -0600, you wrote:
How can I format a date coming out of a MySQL? I know how to format today's date but not a date coming out of MySQL. I have looked through the manual, but I must be blind because I cannot figure it out. Thanks, Clint- - - - - - - - - - - - - - - - - - - - - Fourth Realm Solutions pbechard@fourthrealm.com http://www.fourthrealm.com Tel: 519-739-1652 - - - - - - - - - - - - - - - - - - - - -