Code
<?
$created = 1285774875;
echo $created." - unix timestamp, constant of world creation<br>\n";
echo time()." - unix timestamp, current<br><br>\n";
$world_time = time()-$created;
echo $world_time."- seconds from world creation<br>\n";
echo ($world_time*10) ."- virt seconds from world creation<br>\n";
echo "Real time from creation - ".make_diff($world_time);
echo " Virt time from creation - ".make_diff($world_time*10);
function make_diff($stamp){
$seconds_in_a_year = 3600 * 24 * 365;
$years = floor($stamp / $seconds_in_a_year);
$rest = $stamp % $seconds_in_a_year;
$seconds_in_a_month = 3600 * 24 * 30;
$months = floor ($rest / $seconds_in_a_month);
$rest = $rest % $seconds_in_a_month;
$seconds_in_a_day = 3600 * 24;
$days = floor ($rest / $seconds_in_a_day);
$rest = $rest % $seconds_in_a_day;
$hours = floor ($rest / 3600);
$rest = $rest % 3600;
$minutes = floor ($rest / 60);
$rest = $rest % 60;
$seconds = $rest;
return "$years years, $months months, $days days, $hours hours, $minutes minutes and $seconds seconds<br>\n";
}
?>