php - How to echo a converted time format from mysql datetime column -
i'm trying convert datetimte shorter, error below.
warning:
date_format()
expects parameter 1 datetime, string given in ...
code
$datetime = '2012-03-24 17:45:12'; $time = date_format($datetime, 'g:i a'); echo $time;
what i'm doing wring? thanks.
try datetime
$date = new datetime("2012-03-24 17:45:12"); echo $date->format("g:i a");
Comments
Post a Comment