note 17380 added to function.substr
| From: | sc_99_99 at yahoo dot com | Date: | Thu, 06 Dec 2001 11:52:36 +0000 |
| Subject: | note 17380 added to function.substr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21706@lists.php.net to get a copy of this message | ||
If you want to convert a mysql timestamp to a normal date format,
you can use the following function:
function timestamp_convert($timestamp)
{
$year = substr($timestamp, 0, 4);
$month = substr($timestamp, 4, 2);
$day = substr($timestamp, 6, 2);
$new_date = $year."-".$month."-".$day;
return $newdate;
}
--
http://www.php.net/manual/en/function.substr.php
http://master.php.net/manage/user-notes.php?action=edit+17380
http://master.php.net/manage/user-notes.php?action=delete+17380
http://master.php.net/manage/user-notes.php?action=reject+17380