formfields
Joined: 01 Aug 2005 Posts: 465
|
Posted: Wed Dec 14, 2005 4:59 pm Post subject: How Do I Format a Date? |
|
|
Here is an example of how to format a date so that it displays in standard USA form. This example works with the data described on http://www.formfields.com/tableHelpersArea/tutorial2.php.
| Code: |
$table = new TableSet();
$table->enableSort = true;
$table->loadQuery(
"SELECT advertiser AS 'Advertiser',"
. "clicks AS 'Clicks',"
. "impressions AS 'Impressions',"
. "DATE_FORMAT(date,'%c/%e/%Y') AS 'Day' "
. "FROM traffic"
);
echo $table->getTableTag();
|
For information on date formatting, please see http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html. |
|