Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001)
| From: | Matthew Ralston | Date: | Wed, 23 May 2001 12:57:32 +0000 |
| Subject: | Converting MySQL Date (2001-05-21) to Friendly Date (21 May 2001) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-54028@lists.php.net to get a copy of this message | ||
I've got a date stored in a MySQL database in a "DATE" field, so it is
stored as "2001-05-21". How do I convert that into a more friendly date like
"21 May 2001" or even "21st May 2001" for display on a web page?
I've tried
print date("jS F Y", $dbtable[date]);
but I always get "1st January 1970" because I don't know how to convert the
MySQL date into a PHP timestamp.
Can someone tell me how to do it please?
--
Thanks,
Matt
matthew.ralston@haltoncollege.ac.uk
< www.mralston.co.uk />