开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜