Displaying Unix Timestamps as human readable dates / times?

Displaying Unix Timestamps as human readable dates / times?

am 15.02.2006 15:22:45 von Alex Major

Hi there.
I am currently intergrating a vbulletin forum with my website, and am now
merging the two databases together. On the vbulletin database all
times/dates are stored as a unix timestamp, but in the past I've always
stored mine as 21/3/2006 (for example.) I am now trying to get these unix
timestamps to display as dates / times on my website, but to no avail.

Once I see how to get it working I think I should be ok, so if anyone can
offer some assistance with this then it would be greatly appriciated.

At the moment, I have a select clause -->
mysql_select_db($database_main, $main);
$query_members = "SELECT userid, usergroupid, username, email, homepage,
usertitle, joindate, lastvisit, posts, ipaddress, msn FROM `user` ORDER BY
userid ASC";
$members = mysql_query($query_members, $main) or die(mysql_error());
$row_members = mysql_fetch_assoc($members);
$totalRows_members = mysql_num_rows($members);
?>

And then I am trying to get this date to display as a human readable date.
-->


Anyone have any ideas how? Many thanks.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Displaying Unix Timestamps as human readable dates / times?

am 15.02.2006 15:48:23 von Michael Crute

On 2/15/06, Alex Major wrote:
> Thanks for the link, I've had a read through but I don't think I'm quite
> grasping it.
> From what I think I understand, if I put this..
> date ( "m.d.y" [, 'joindate'] )
>
> Then I would get the date displayed like 03.03.01 (for the 3rd March 2001=
).
> Or is that incorrect?
> Any tips greatly appriciated.
>
>
> On 15/2/06 14:28, "Michael Crute" wrote:
>
> > On 2/15/06, Alex Major wrote:
> >> Hi there.
> >> I am currently intergrating a vbulletin forum with my website, and am =
now
> >> merging the two databases together. On the vbulletin database all
> >> times/dates are stored as a unix timestamp, but in the past I've alway=
s
> >> stored mine as 21/3/2006 (for example.) I am now trying to get these u=
nix
> >> timestamps to display as dates / times on my website, but to no avail.
> >>
> >> Once I see how to get it working I think I should be ok, so if anyone =
can
> >> offer some assistance with this then it would be greatly appriciated.
> >>
> >
> >>
> >> And then I am trying to get this date to display as a human readable d=
ate.
> >> -->
> >>
> >>
> >> Anyone have any ideas how? Many thanks.
> >
> >
> > Yes, check out the date command. http://php.net/date
> >
> > -Mike


Close, you would do something more like

date('m.d.y', $row_members['joindate']);


--
________________________________
Michael E. Crute
http://mike.crute.org

Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php