php - mysql timestamp convertion -
What is the correct way to choose your own from the MySQL timestamp (YYYY-MM-DD HH: MM: SS) Something like the format, "5 August 2010"? How can I do mysql timestamp php date () compatible?
There are two ways ...
First of all, do it in PHP Can ...
$ time = strtotime ('2010-05-05 05:05:05'); Echo date ('FJ, Y', $ time); Or, you can convert it to MySQL in Unix time: SELECT UNIX_TIMESTAMP (`your timestamp column ') blahblah ... .
After you bring it, it will need to be formatted in date ()
.
Or, you can do the whole thing right with MySQL:
SELECT DATE_FORMAT (`your timestamp column ','% M% e,% Y ') FROM ...
Comments
Post a Comment