If you would like to get a nice format on the datetime field stored in MySQL, use the following code:
<?php
$datetime = strtotime($row_links['dateAdded']); // The date time field
$formatDate = date("m/d/y g:i A", $datetime);
echo $formatDate;
?>
This will output something like:
01/01/12 8:07 PM
If you want more formatting options for the date(), you can review the manual on PHP.net here.
No comments:
Post a Comment