Jump to content

[SOLVED] timestamp query


e1seix

Recommended Posts

<?
//getting days in between 2 timestamps;
$start = "2009-01-05";
$end = date("Y-m-d");

echo "\$start: ".strtotime($start)."<br>";
echo "\$end: ".strtotime($end)."<br>";

$difference = (strtotime($end)-strtotime($start));

$days = $difference/24; //hours in one day
$days = $days/60; //minutes in one hour
$days = $days/60; //seconds in one minute
$days = ceil($days); //rounding up

echo "\$days in between: $days";
?>

 

have found this curious little script which does exactly what i wanted... for any of you that are looking for similar. :)

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.