converting DATETIME to a readable date.
| From: | DRN | Date: | Sun, 15 Apr 2001 00:34:08 +0000 |
| Subject: | converting DATETIME to a readable date. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-48607@lists.php.net to get a copy of this message | ||
Hi, I have a MySQL table recording errors, 1 of the fields is a
DATETIME, to give me the time of the error.
I have made a file which will then display a table of errors.
I would like to display the date and time in a more readable format,
even just with spaces between the years & months etc.
Having a look through the php online documentation I found this
example:
~~
If you have a MySQL column with of the DATETIME type, and you want to
format the values to a different representation, use this code:
$date = $row["date"];
$new_date = date("l, j M Y, G:i:s", strtotime($date));
~~
but I cannot get this to work :(, I get an "unexpected error in
date()"
I don't (yet) know enough about php to work out what this error is,
could someone help.
Cheers for your help, Donald
__________________________________________
As well as learning more,
I learn that there is even more I don't know
http://www.donaldrnoble.f2s.com
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯