src/Converter/UnixTimeConverter/Time.php
public function convertMicrosecondsToTime($time)
    {
        // Calculating day-ratio;
        // Dividing microseconds per seconds results in the intended value
        $ratio = intval($time / $this->dayLengthInSeconds);

        // If using a different time format, apply ratio
        $timeScale = array_product($this->ranges);

        if ($this->dayLengthInMicroSeconds !== $timeScale) {
            $time = intval(
                ($time * $timeScale) / $this->dayLengthInMicroSeconds
            );
        }

        $len = count($this->ranges);
        $res = array_fill(0, $len, 0);

        for ($i=$len - 1; $i > -1; $i--) {
            $res[$i] = $time % $this->ranges[$i];
            $time = intval($time / $this->ranges[$i]);
        }

        return new TimeObject($res, $this->ranges, $ratio);
    }
public function convertMicrosecondsToTime($time)
    {
        // Calculating day-ratio;
        // Dividing microseconds per seconds results in the intended value
        $ratio = intval($time / $this->dayLengthInSeconds);

        // If using a different time format, apply ratio
        $timeScale = array_product($this->ranges);

        if ($this->dayLengthInMicroSeconds !== $timeScale) {
            $time = intval(
                ($time * $timeScale) / $this->dayLengthInMicroSeconds
            );
        }

        $len = count($this->ranges);
        $res = array_fill(0, $len, 0);

        for ($i=$len - 1; $i > -1; $i--) {
            $res[$i] = $time % $this->ranges[$i];
            $time = intval($time / $this->ranges[$i]);
        }

        return new TimeObject($res, $this->ranges, $ratio);
    }
public function convertMicrosecondsToTime ( $ time ) { // Calculating day-ratio; // Dividing microseconds per seconds results in the intended value $ ratio = intval ( $ time / $ this -> dayLengthInSeconds ) ; // If using a different time format, apply ratio $ timeScale = array_product ( $ this -> ranges ) ; if ( $ this -> dayLengthInMicroSeconds !== $ timeScale ) { $ time = intval ( ( $ time * $ timeScale ) / $ this -> dayLengthInMicroSeconds ) ; } $ len = count ( $ this -> ranges ) ; $ res = array_fill ( 0 , $ len , 0 ) ; for ( $ i = $ len - 1 ; $ i > - 1 ; $ i -- ) { $ res [ $ i ] = $ time % $ this -> ranges [ $ i ] ; $ time = intval ( $ time / $ this -> ranges [ $ i ] ) ; } return new TimeObject ( $ res , $ this -> ranges , $ ratio ) ; }
Convert a time expressed in microseconds, into a Time object.

@param integer $time

@return TimeObject
Convert a time expressed in microseconds into a Time object .