I am attempting to convert a number in seconds into a date. What I've established is that the figure I am attempting to convert is how many seconds it's been since: 01 Jan 1970 00:00:00 GMT. Now I am wondering if there is a function that already exists to convert this figure (in seconds) to a timestamp, and if not would writing a script to convert such a figure into a date be all that difficult? As of now I have the following:
<?php
$query = @mysql_query("SELECT tid, title, posts, start_date, starter_id, starter_name, forum_id FROM xnftopics WHERE forum_id=25 ORDER BY tid DESC LIMIT 0, 3");
while ($data = @mysql_fetch_object($query)) {
?>
<p align="justify"><b><?=$data->title?></b>
<br>Written by <b><a href="http://www.xarnet.net/index.php?act=Profile&CODE=03&MID=<?=$data->starter_id?>"><?=$data->starter_name?></a></b> on <?php
$estdate = ($data->start_date)-180000;
$yearfigure = round($estdate/60/60/24/365.25 - 0.5, 0);
$year = 1970 + $yearfigure;
$yearseconds = $yearfigure*365.25*24*60*60;
$minusyear = $estdate - $yearseconds;
echo $year;
?>
<br> ...more code for the post...
<?php
}
?>
But I'm not sure how to do the rest, also I would like to be able to have it as a timestamp when I'm done (if possible).
Any help on this issue would be greatly appreciated.
Note: I cannot simply go and change the column to a timestamp, as it's a column used by a forum.