Jump to content


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


Convert Timestamp to Date/Time in MySql Select statement

Recommended Posts

I've been trying, researching and writing different snippets for 2 days to try and get a unix timestamp converted to a date/time.


Here is the select statement


  $q = "SELECT fname,email,timestamp "      ."FROM ".TBL_USERS." ORDER BY userlevel DESC,fname";  $result = $database->query($q);  /* Error occurred, return given name by default */  $num_rows = mysql_numrows($result);


Here is the


for($i=0; $i<$num_rows; $i++){      $fname  = mysql_result($result,$i,"fname");      $email  = mysql_result($result,$i,"email");      $time  = mysql_result($result,$i,"timestamp");


I have tried using a convert timestamp function, I've tried converting in the select statememt.


I most be missing something here, any ideas[/]

Share this post

Link to post
Share on other sites

  • 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.