PHP date() function
I'm having an auto created timestamp on update from the da开发者_StackOverflowtabase that looks like this: y/m/d h:i:s..
And when I want to echo it it's like: Y/m/d h:i:s, and what I would like it to be is: d/m/Y H:i:s..
But if I use this:
$date = $row['created_timestamp'];
$date_added = date('d/m/Y', H:i:s);
It'll print the date right, but the time is the current time. How do I change this to be the stored time from my database?
Thanks :-)
$date_added = date('d/m/Y H:i:s', strtotime($date));
Should do the trick.
精彩评论