Reputation: 4857
I am trying to convert some date 'date' (created with current_timestamp()), and displaying 2013-02-13 17:38:08, and I don't want the seconds to appear. But when I use date('Y-m-d H:i', $date)
, I get
1970-01-01 01:33
I think I am not using the right php methods, someone could help ?
Best, Mehdi
Upvotes: 1
Views: 39
Reputation: 7525
date
accepts a parameter as a timestamp, so use strtotime
to convert first:
date('Y-m-d H:i', strtotime($date))
might it just be easier to use substr
?
Upvotes: 3