我正在尝试转换一些日期"date"(用current_timestamp()创建),并显示2013-02-13 17:38:08,我不希望出现秒。但当我使用date('Y-m-d H:i', $date)
时,我会得到
1970-01-01 01:33
我认为我没有使用正确的php方法,有人可以帮忙吗?
最佳,Mehdi
date
接受参数作为时间戳,因此首先使用strtotime
进行转换:
date('Y-m-d H:i', strtotime($date))
使用substr
会更容易吗?