private static function timestampToCounter($timestamp, $timeStep)
    {
        $timestamp = abs(intval($timestamp));
        $counter = intval(($timestamp * 1000) / ($timeStep * 1000));

        return $counter;
    }
private static function timestampToCounter($timestamp, $timeStep)
    {
        $timestamp = abs(intval($timestamp));
        $counter = intval(($timestamp * 1000) / ($timeStep * 1000));

        return $counter;
    }
private static function timestampToCounter ( $ timestamp , $ timeStep ) { $ timestamp = abs ( intval ( $ timestamp ) ) ; $ counter = intval ( ( $ timestamp * 1000 ) / ( $ timeStep * 1000 ) ) ; return $ counter ; }
Convert a timestamp into a usable counter value

@param  integer $timestamp A UNIX timestamp.
@param  integer $timeStep  The timestep value.
@return integer Returns the calculated counter value.
Convert a timestamp into a usable counter value