Posted: Mon Feb 12, 2007 1:20 pm
I usually do something like this:
Comments don't scare me so much, so I use them to allow me to come back and easily distinguish what I was doing. Even though
Seems self explanatory, there is nothing really saying that the units you are using is seconds. It could be 24 parcels per worker, 60 workers per station, 60 stations per region and one days output is 86400 parcels in a region. I know that's a stretch, but a simple comment speaks more to me that making an assumption as to what was intended simply by looking at the values used in a math routine (which to me still does not make sense to have PHP do).
Code: Select all
<?php
/**
* Lets get the time... in seconds... because for some reason
* PHP needs to do everything in seconds from January 1, 1970
*/
$timestamp = time();
// Now check to see if now less reset time is greater than one day
// (in seconds, thanks again to PHP's wonderful handling of dates
if ($timestamp - $profitreset->reset >= 86400 )
{
//
}
?>Code: Select all
<?php
$one_day = 60 * 60 * 24;
?>