Finds the number of leap seconds as of the instance's date.

@return float
420232
public function leapSec()
    {
        // Load data file
        $file = new \SplFileObject($this->storage('tai-utc.dat'));

        $taiUTC = 0;
        while ($file->valid()) {
            $line = $file->getCurrentLine();

            // Check for empty line
            if (trim($line) == '') {
                break;
            }

            // Get JD and leap seconds as of that JD
            $jd = (float)substr($line, 17, 9);

            // If the leap second JD exceeds or is = to this instance, break
            if ($jd > $this->jd) {
                break;
            }

            // Within range, use current leap seconds
            $taiUTC = (float)substr($line, 38, 10);
        }

        // Return leap seconds
        return $taiUTC;
    }
36806
public function getRetentionTime()
    {
        if (is_array($this->retentionTimeWindow)) {
            return ($this->retentionTimeWindow[static::RETENTION_TIME_START] +
                $this->retentionTimeWindow[static::RETENTION_TIME_END]) / 2;
        }
        
        return $this->retentionTimeWindow;
    }
1187635
public function getDuration()
    {
        if (null === $this->data) {
            return 0;
        }

        $time = 0;
        foreach ($this->data as $data) {
            $time += $data['duration'];
        }

        return $time;
    }
219276
public function UTCTimeZoneOffset() : int
    {
        $originDateTime = new \DateTime('now', $this);

        $utcTimeZone = new \DateTimeZone('UTC');
        $utcDateTime = new \DateTime('now', $utcTimeZone);

        return $utcTimeZone->getOffset($utcDateTime) - $this->getOffset($originDateTime);
    }
1084890
public function getMicrotime($get_as_float = false)
    {
        if ($get_as_float) {
            $converter = new MicrotimeConverter();
            return $converter->convertStringToFloat($this->timestamp);
        } else {
            return $this->timestamp;
        }
    }
407842
public function calculateTimings()
    {
        if ($this->_timings === null) {
            $this->_timings = Yii::getLogger()->calculateTimings(isset($this->data['messages']) ? $this->data['messages'] : []);
        }

        return $this->_timings;
    }
510087
public static function get_microtime() {
        list($tps_usec, $tps_sec) = explode(' ', microtime());
        return (float) $tps_usec + (float) $tps_sec;
    }
191672
protected function getTimearray()
    {
        $intSeconds = abs($this->intSeconds);

        $intYears = floor($intSeconds / DateTimeSpan::SECONDS_PER_YEAR);
        $intSeconds = $intSeconds - ($intYears * DateTimeSpan::SECONDS_PER_YEAR);

        $intMonths = floor($intSeconds / DateTimeSpan::SECONDS_PER_MONTH);
        $intSeconds = $intSeconds - ($intMonths * DateTimeSpan::SECONDS_PER_MONTH);

        $intDays = floor($intSeconds / DateTimeSpan::SECONDS_PER_DAY);
        $intSeconds = $intSeconds - ($intDays * DateTimeSpan::SECONDS_PER_DAY);

        $intHours = floor($intSeconds / DateTimeSpan::SECONDS_PER_HOUR);
        $intSeconds = $intSeconds - ($intHours * DateTimeSpan::SECONDS_PER_HOUR);

        $intMinutes = floor($intSeconds / DateTimeSpan::SECONDS_PER_MINUTE);
        $intSeconds = $intSeconds - ($intMinutes * DateTimeSpan::SECONDS_PER_MINUTE);

        if ($this->isNegative()) {
            // Turn values to negative
            $intYears = ((-1) * $intYears);
            $intMonths = ((-1) * $intMonths);
            $intDays = ((-1) * $intDays);
            $intHours = ((-1) * $intHours);
            $intMinutes = ((-1) * $intMinutes);
            $intSeconds = ((-1) * $intSeconds);
        }

        return array(
            'Years' => $intYears,
            'Months' => $intMonths,
            'Days' => $intDays,
            'Hours' => $intHours,
            'Minutes' => $intMinutes,
            'Seconds' => $intSeconds
        );
    }
409876
protected function getTimestamp()/*# : string */
    {
        $num = bcadd(
            bcmul((microtime(true) - strtotime(static::$epoch)), 100000000),
            $this->getSequence() % 10000
        );
        return substr('00' . static::fromBase10($num, self::BASE16), -15);
    }
965467
public function getDuration()
    {
        if (!isset($this->data['events']['__section__'])) {
            return 0;
        }

        $lastEvent = $this->data['events']['__section__'];

        return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
    }
1297956
static public function get_time() {
        // By David Maciel (jdmaciel@gmail.com)
        list($microsecond, $second) = explode(" ", \microtime());
        // remove '0.' from the beginning and trailing zeros(2) from the end
        $microsecond = substr($microsecond, 2, -2);
        return (int) $second . $microsecond;
    }
204725
public function getTimestamp()
    {
        if ($this->isNull($this->value)) {
            return null;
        }
        $value = strtotime($this->getValue());

        return $value ?: null;
    }
364744
public static function SecondsFromTime( $arg )
	{
		if ( $arg instanceof Undefined )
		{
			return Undefined::getValue();
		}

		if ( ! $arg instanceof TimeValue )
		{
			return Undefined::getValue();
		}

		/**
		 * @var TimeValue $time
		 */
		$time = $arg;
		// return $time->Value->format( "s" ) + 0;
		return DecimalValue::FromValue( ( $time->Value->format( "s" ) + ( @isset( $time->Value->microseconds ) ? "0." . $time->Value->microseconds : 0 ) ) );
	}
570824
public function toEpochDay() : int
    {
        $y = $this->year;
        $m = $this->month;

        $total = 365 * $y;

        if ($y >= 0) {
            $total += \intdiv($y + 3, 4) - \intdiv($y + 99, 100) + \intdiv($y + 399, 400);
        } else {
            $total -= \intdiv($y, -4) - \intdiv($y, -100) + \intdiv($y, -400);
        }

        $total += \intdiv(367 * $m - 362, 12);
        $total += $this->day - 1;

        if ($m > 2) {
            $total--;
            if (! $this->isLeapYear()) {
                $total--;
            }
        }

        return $total - self::DAYS_0000_TO_1970;
    }
631431
public function getEndTime()
    {
        $count = \count($this->periods);

        return $count ? $this->periods[$count - 1]->getEndTime() : 0;
    }
323587
public function getMicroseconds() {
        try {
            $t = microtime(true);
            $micro = sprintf("%06d",($t - floor($t)) * 1000000);
            return intval($micro);
        }  catch (\Exception $e){
            die($e);
        }    
    }
1308377
protected function getMicrotime(): float
    {
        list ($uSec, $sec) = \explode(' ', \microtime());
        return ((float)$uSec + (float)$sec);
    }