Jump to content

Converting time() after retrevial


Superman702

Recommended Posts

Newbie question...  :-[

 

I have a form in which I submit time() into an INT on MySQL.

 

After I retrieve that table with the old UNIX Timestamp on it, how do I convert it from .$info['timestamper'] . (which holds the timestamp) into a date and time output? (i.e. 01:05:05 PM 12/25/2010)

 

My Current Code:

$mins = time()-60*60*24*3; //Last 72 hours
$result = mysql_query("SELECT * FROM messages WHERE `timestamper` > '$mins'");
$num_rows = mysql_num_rows($result);
echo "<CENTER><table border cellpadding=3><TR><TH>Message</TH><TH>Sent By</TH><TH>Time</TH></TR>";
while($info = mysql_fetch_assoc($result)){
Print "<tr><TH>".$info['display'] . "</th> <th>".$info['username'] ."<TH>".$info['timestamper'] ."</TH></TR>"; 
}

Link to comment
https://forums.phpfreaks.com/topic/245404-converting-time-after-retrevial/
Share on other sites

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.