Extracting Usable Info From datetime field in php/MySQL -
i trying format datetime variable following code:
$passed_time = $stu_quiz->c_date_time; $passed_time_string = date_format($passed_time, 'm-d-y'); for reason, if print $passed_time_string, output blank, if print out $passed_time, date (in format 2011-06-15 21:43:09).
why date_format method not working?
the date_format function expects "datetime" object created using date_create.
example:
$passed_time = date_create($stu_quiz->c_date_time); $passed_time_string = date_format($passed_time, 'm-d-y');
Comments
Post a Comment