Returns time (hour minutes seconds) when to perform license check.
Create if does not exist.

@return string time formed as H:i:s
189144
private function getCheckTime()
    {
        $checkTime = $this->getConfig()->getSystemConfigParameter('sOnlineLicenseCheckTime');
        if (!$checkTime) {
            $hourToCheck = rand(8, 23);
            $minuteToCheck = rand(0, 59);
            $secondToCheck = rand(0, 59);

            $checkTime = $hourToCheck . ':' . $minuteToCheck . ':' . $secondToCheck;
            $this->getConfig()->saveSystemConfigParameter('str', 'sOnlineLicenseCheckTime', $checkTime);
        }

        return $checkTime;
    }
541986
private function getLogTime()
    {
        $diff = $this->microtime_diff($this->init);
        $format = gmdate("H:i:s",(int)$diff);
        $diff = sprintf("%01.5f", $diff);
        $format .= substr($diff,strpos((string)$diff,'.'));
        return $format;
    }
286459
public static function isValidHour($time)
    {
        $result = preg_match('/^([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2}))?$/', $time, $regs);
        if ($result) {
            $hour = $regs[1];
            $minutes = $regs[2];
            $result = ($hour >= 0 && $hour < 24) && ($minutes >= 0 && $minutes < 60);
            if ($result && isset($regs[3])) {
                $seconds = $regs[3];
                $result = $seconds >= 0 && $seconds < 60;
            }
        }
        return $result;
    }
214660
public function getExecutionTime()
    {
        if(!$this->getFinishedAt()) {
            $now = new \DateTime();
            return $now->getTimestamp() - $this->getCreatedAt()->getTimestamp();
        } else {
            return $this->getFinishedAt()->getTimestamp() - $this->getCreatedAt()->getTimestamp();
        }
    }
924760
public function formatsSeconds($seconds)
    {
        $h = ($seconds >= 3600) ? (int) round($seconds / 3600) : 0;
        $time = ($seconds >= 3600) ? $seconds % 3600 : $seconds;
        $m = (int) $time / 60;
        $s = (int) $time % 60;

        return (int) $h.':'.(int) $m.':'.(int) $s;
    }
811002
public static function formatSeconds($seconds)
    {
        $format = '';
        $rest = $seconds;
        if ($seconds >= 86400) {
            $format .= floor($seconds/86400).'d ';
            $rest = $seconds%86400;
        }

        if ($rest >= 3600) {
            $format .= floor($rest/3600).'h ';
            $rest = $rest%3600;
        }

        if ($rest >= 60) {
            $format .= floor($rest/60) . 'min ';
            $rest = $rest%60;
        }

        if ($rest > 0) {
            $format .= $rest . 'sec ';
        }

        return trim($format);
    }
865292
public function getTime()
    {
        $time = new \DateTime($this->data['transaction_date'], new \DateTimeZone('EST'));
        $time->setTimezone(new \DateTimeZone('UTC'));

        return $time->format('c');
    }
273526
static public function create_time($value=null)
    {
        return (empty($value)) ? time() : (is_numeric($value) ? $value : strtotime($value));
    }
901138
public function formatTime($time)
    {
        $time = preg_match('~\D~', $time) ? strtotime($time) : $time;

        return time() - $time;
    }
1202341
public function getHoursWithUnit()
    {
        if ($this->hours == 1) {
            $postfix = ' hour';
        } else {
            $postfix = ' hours';
        }

        return $this->hours . $postfix . ' on ' . $this->log_date . '';
    }
1304651
public static function toTimeString($time)
    {
        $times = array(
            'hour'   => 3600000,
            'minute' => 60000,
            'second' => 1000
        );

        $ms = $time;

        foreach ($times as $unit => $value) {
            if ($ms >= $value) {
                $time = floor($ms / $value * 100.0) / 100.0;
                return $time . ' ' . ($time == 1 ? $unit : $unit . 's');
            }
        }
        return $ms . ' ms';
    }
878828
public function getDurationFormatted()
	{
		$duration = $this->getDuration();

		if ($duration->d == 0 && $duration->h == 0 && $duration->i == 0) {
			return 'Less than minute';
		}

		$ret = '';

		if ($duration->d == 1) {
			$ret .= 'One day';
		} else if ($duration->d > 1) {
			$ret .= $duration->d . ' days';
		}

		if ($duration->h == 1) {
			if (!empty($ret)) {
				$ret .= ', one hour';
			} else {
				$ret .= 'One hour';
			}
		} else if ($duration->h > 1) {
			if (!empty($ret)) {
				$ret .= ', ' . $duration->h . ' hours';
			} else {
				$ret .= $duration->h . ' hours';
			}
		}

		if ($duration->i == 1) {
			if (!empty($ret)) {
				$ret .= ', one minute';
			} else {
				$ret .= 'One minute';
			}
		} else if ($duration->i > 1) {
			if (!empty($ret)) {
				$ret .= ', ' . $duration->i . ' minutes';
			} else {
				$ret .= $duration->i . ' minutes';
			}
		}

		return $ret;
	}
592753
public static function create($time = null)
    {

        if (is_string($time)) {
            $time = new self($time);
        }

        if (self::isNullOrBnDateTimeObject($time)) {
            return $time;
        }

        $dateTime = new self();

        if ($time instanceof \DateTime) {
            $dateTime->setTimezone($time->getTimezone());
            $time = $time->getTimestamp();
        }

        $dateTime->setTimestamp($time);
        return $dateTime;
    }
827620
public function time()
    {
        $format = $this->format;

        $format = $this->replace('u', 6, $format);

        $format = $this->replace('ms', 3, $format);

        return gmdate($format, $this->time);
    }
479703
function time(): int {
        if($this->nativeHrtime) {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \hrtime(true);
            $elapsed = (int) ($time - $this->lastTime);
            $this->lastTime = $time;
        } elseif($this->hrtime) {
            $this->timer->stop();
            $elapsed = (int) $this->timer->getLastElapsedTime(\HRTime\Unit::NANOSECOND);
            $this->timer->start();
        } else {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \microtime(true);
            $elapsed = $time - $this->lastTime;
            
            $this->lastTime = $time;
            $elapsed = \ceil(($elapsed * 1000000000));
        }
        
        return ((int) $elapsed);
    }
675388
public static function format($time): string
    {
        $time = round($time * 1000);
        foreach (self::$times as $unit => $value) {
            if ($time >= $value) {
                $time = floor($time / $value * 100.0) / 100.0;
                return $time . ' ' . $unit . ((float)$time === 1.0 ? '' : 's');
            }
        }

        return $time . ' ms';
    }
187700
public function getTotalSeconds()
	{
		// Use the days value if it is available otherwise the months value will be used which gives
		// nonsense results when the duration has been created from a day interval because the
		// DateInterval assumes 30 days to every month!
		// BMS 2018-03-20 Changed to look at the 'daysOnly' property and use the 'd' value if it is.
		//				  On this date the parent::getTotalSeconds() function returns a value that is out by an hour
		//				  when returning the interval of this expression:
		//				  (xs:dateTime("1999-10-23T09:08:07Z") - xs:dateTime("1998-09-09T04:03:02Z"))
		//				  which appears in test 'op-subtract-dateTimes-yielding-DTD-19' in 'dateTimesSubtract.xml'
		//				  This interval is 408 days 22 hours 58 minutes and 59 seconds

		if ( ! $this->Value->days && ( $this->Value->y || $this->Value->m ) ) return parent::getTotalSeconds();
		// if ( ! $this->Value->days && ! $this->Value->daysOnly ) return parent::getTotalSeconds();

		$seconds = new DecimalValue( ( $this->Value->days ? $this->Value->days : $this->Value->d ) * 86400 + $this->Value->h * 3600 + $this->Value->i * 60 + $this->Value->s );
		$seconds = $seconds->Add( "0.{$this->Value->microseconds}" );
		if ( $this->Value->invert )
		{
			$seconds = $seconds->Mul( -1 );
		}

		return $seconds;
	}