Page 1 of 1

get how minutes has passed with time()

Posted: Mon Aug 22, 2005 3:26 pm
by psychotomus
How can I get how minutes have passed using time();

Posted: Mon Aug 22, 2005 3:30 pm
by feyd
time() / 60

:? is that what you are asking? Or do you want it in relation to a specific time?

Posted: Mon Aug 22, 2005 8:50 pm
by s.dot
time()/60 will give you the number of minutes since January 01st, 1970, correct?

You'll need a starting time to compare the minutes passed with.

Code: Select all

$starttime = some unix timestamp;
$endtime = time();

$timepassed = ($endtime-$starttime)/60;
echo $timepassed;

Posted: Mon Aug 22, 2005 9:36 pm
by Ambush Commander
You probably want to round() that... 3.4238742 minutes isn't all that appealing.