Codeigniter: return datetime from db formatted
I'd like开发者_如何学运维 to format a datetime entry stored in a SQL db in a friendly format.
I'm just returning a simple query as a row(date)...
Is there a quick/easy way to do this?
I can post examples, if need be.
Right now the query is in a foreach loop:
<?php print $row['exp_date']?>
You can always use the php date function
Day of the week:
echo date("l", strtotime($row['exp_date'])); // monday
More complex sample:
echo date("l jS \of F Y h:i:s A", strtotime($row['exp_date'])); // Monday 8th of August 2005 03:12:46 PM
精彩评论