Jump to content

Unix


steveangelis

Recommended Posts

I havelook around but not found what I need.

 

I am tryingto do something simple and it will not work for me correctly:

 

mysql_query("insert into test SET test = UNIX_TIMESTAMP(NOW())");

$result=mysql_query("SELECT UNIX_TIMESTAMP(test) AS FORMATED_TIME FROM test"); 
$FORMATED_TIME=mysql_result($result,0,"FORMATED_TIME"); 

$date=date("H:i:sa",$FORMATED_TIME); 

echo "$date"; 

 

What this SHOULD do is insert the current date/time into the database and retreive it to show it but I am getting this:

 

16:00:00pm

 

What am I doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/155650-unix/
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.