HoursFromTime
@param object $arg
@return int
961605
public static function HoursFromTime( $arg )
	{
		if ( $arg instanceof Undefined )
		{
			return Undefined::getValue();
		}

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

		/**
		 * @var TimeValue $time
		 */
		$time = $arg;
		return $time->Value->format( "H" ) + 0;
	}
588492
public static function AdjustDateToTimezone( $arg )
	{
		if ( $arg instanceof Undefined )
			return Undefined::getValue();

		/**
		 * @var DateValue $date
		 */
		$date = $arg;
		if ( $date->IsLocal ) return $date;

		$dt = clone $date->Value;
		$dtz = new \DateTimeZone( date_default_timezone_get() );
		$dt->setTimezone( $dtz );
		$dateTime = DateValue::fromDate( $date->S,  $dt, false );
		$dateTime->IsLocal = false;
		return $dateTime;

	}
771042
protected function get12hHour() : int
   {

      if ( $this->isAnteMeridiem() )
      {
         return $this->getHour();
      }

      if ( $this->properties[ 'hour' ] == 0 )
      {
         return 12;
      }

      if ( $this->properties[ 'hour' ] > 12 )
      {
         return $this->properties[ 'hour' ] - 12;
      }

      return $this->properties[ 'hour' ];

   }
738234
public function compare(Enum $arg) {
        if ($this->value == $arg->value) {
            return 0;
        } elseif ($this->value > $arg->value) {
            return -1;
        } else {
            return 1;
        }
    }
536100
public static int getHour(Date timeFrom) {
		Calendar instance = Calendar.getInstance();
		instance.setTime(timeFrom);
		int hour = instance.get(Calendar.HOUR);
		return hour;

	}
830183
public function hourRange($openingTime, $closingTime){
        $time1 = strtotime($openingTime);
        $time2 = strtotime($closingTime);
        return round(abs($time2 - $time1) / 3600,2);
    }
455391
public function getAvgExecutionTime(): float
    {
        return $this->getTotalExecutionTime() ? ($this->getTotalExecutionTime() / \count($this->data['commands'])) : (float) 0;
    }
528321
public function getCurrentTime(): int
    {
        static $time = 0;
        if (0 !== $time) {
            return $time;
        }
        $time = \time();
        if (isset($GLOBALS['EXEC_TIME']) && MathUtility::canBeInterpretedAsInteger($GLOBALS['EXEC_TIME'])) {
            $time = (int)$GLOBALS['EXEC_TIME'];
        }

        return $time;
    }
630913
function timeStamp()
    {
        $cur_date = getdate();
        $longtimestamp = mktime( $this->hour(),
                                 $this->minute(),
                                 $this->second(),
                                 $cur_date[ 'mon' ],
                                 $cur_date[ 'mday' ],
                                 $cur_date[ 'year' ] );
        return $longtimestamp;
    }
627067
public function timestamp($arg = null) {
        $sql = 'TIMESTAMP';
        if (!empty($arg)) {
            $sql .= '('.intval($arg).')';
        }
        return $this->addData(self::KIND, $sql);
    }
56558
public static function AdjustDateTimeToTimezone( $arg )
	{
		if ( $arg instanceof Undefined )
		{
			return Undefined::getValue();
		}

		/**
		 * @var DateTimeValue $dateTime
		 */
		$dateTime = $arg;
		// if ( $dateTime->IsLocal ) return $dateTime;

		$dt = clone $dateTime->Value;
		// $dt->IsLocal = true;
		$dtz = new \DateTimeZone( date_default_timezone_get() );
		$dt->setTimezone( $dtz );
		$dateTime = DateTimeValue::fromDate( $dateTime->S,  $dt, false );
		$dateTime->IsLocal = false;
		return $dateTime;
	}
749429
public function getOffsetFromGMT($hours = false)
	{
		return (float) $hours ? ($this->_tz->getOffset($this) / 3600) : $this->_tz->getOffset($this);
	}
936902
public function getServerTime()
    {
        $response = $this->getConnection()->get(Urls::URL_ADMIN_TIME);
        $data     = $response->getJson();

        return $data['time'];
    }
48389
public static function timeStamp($time)
    {
        $different = time() - $time;

        $seconds = $different;
        $minutes = round($different / 60);
        $hours = round($different / 3600);
        $days = round($different / 86400);
        $weeks = round($different / 604800);
        $months = round($different / 2419200);
        $years = round($different / 29030400);

        //Second
        if ($seconds <= 60) {
            if ($seconds == 1) {
                return "$seconds second ago";
            } else {
                return "$seconds seconds ago";
            }
        }

        //Minutes
        elseif ($minutes <= 60) {
            if ($minutes == 1) {
                return "$minutes minute ago";
            } else {
                return "$minutes minutes ago";
            }
        }

        //Hours
        elseif ($hours <= 24) {
            if ($hours == 1) {
                return "$hours hour ago";
            } else {
                return "$hours hours ago";
            }
        }

        //Days
        elseif ($days <= 7) {
            if ($days = 1) {
                return "$days day ago";
            } else {
                return "$days days ago";
            }
        }

        //Weeks
        elseif ($weeks <= 4) {
            if ($weeks == 1) {
                return "$weeks week ago";
            } else {
                return "$weeks weeks ago";
            }
        }

        //Months
        elseif ($months <= 12) {
            if ($months == 1) {
                return "$months month ago";
            } else {
                return "$months months ago";
            }
        }

        //Years
        else {
            if ($years == 1) {
                return "$years year ago";
            } else {
                return "$years years ago";
            }
        }
    }
649783
public function getOffsetFromGmt($hours = false)
    {
        return (float) $hours ? ($this->tz->getOffset($this) / 3600) : $this->tz->getOffset($this);
    }
898613
public function diffInRealHours($date = null, $absolute = true)
    {
        return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR);
    }
166921
public static function hoursAgo()
    {
        return self::getOrCreate('hours-ago', function () {
            return RangeRule::createForNegativeValues(Unit::HOUR, Unit::DAY - 1, [Results::class, 'calculateHoursAgo']);
        });
    }