Jump to content

Need Help With Changing Date Display From Mysql


webguync

Recommended Posts

I'm a little rusty at this. I have a field in MySQL set to type of timestamp and I am displaying it in an HTML table and it displays as 2012-10-14 13:09:07. I would rather have at display as Sunday, October 14th at 3:09.

 

The code to pull the data is as follow:

 

<?php

mysql_connect("localhost","uname","pw");//database connection
mysql_select_db("DBName");

$SQL = "SELECT * FROM organization ORDER BY time_created_t ASC";


$result = mysql_query($SQL);    
lt

while($data = mysql_fetch_row($result)){
 echo("<tr><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td><td>$data[4]</td><td>$data[5]</td><td>$data[6]</td><td>$data[7]</td><td>$data[8]</td><td>$data[9]</td><td>$data[10]</td><td>$data[11]</td><td>$data[12]</td></tr>");
}
?>

 

 

the timestamp is in <td>$data[12]</td>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.