PDA

View Full Version : Displaying time


HexOnxOnx
Fri 11th Mar '05, 2:41pm
HI all

I have a custom made photo ratings site with some custom made forums. When a post is made, the time of the post is converted to the date using:

$post_time = mysql_result($result, $i, "post_time");

//Convert unix timestamp to date

$post_time = date("Y-m-d", $post_time);

Now if I try to add the actual time the post was made using:

$post_time1 = mysql_result($result, $i, "post_time");

I get this displayed on the post: 1110563187

How do I get this to show the actual time in the hour and minute the post was made

Thanks. I hope this is ok to post here since this isn't a script meant to compete with vB.

HexOnxOnx
Fri 11th Mar '05, 3:14pm
I figured it out, here is what I did:

$post_time = mysql_result($result, $i, "post_time");

$post_time1 = mysql_result($result, $i, "post_time");

//Convert unix timestamp to date

$post_time1 = date("Y-m-d", $post_time);

$post_time = date("h:i:s", $post_time);

I then displayed the time calling up $post_time