Get the wrapped element as any time type.

@throws \UnexpectedValueException If the element is not a time
@return TimeType
421758
public function asTime(): TimeType
    {
        if (!$this->_element instanceof TimeType) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_TIME));
        }
        return $this->_element;
    }
708846
public function asTagged(): TaggedType
    {
        if (!$this->_element instanceof TaggedType) {
            throw new \UnexpectedValueException(
                "Tagged element expected, got " . $this->_typeDescriptorString());
        }
        return $this->_element;
    }
1261072
public function readUNBDateTimeOfPreparation()
    {
        // separate date (YYMMDD) and time (HHMM)
        $date = $this->readEdiDataValue('UNB', 4, 0);
        if (!empty($date)) {
            $time = $this->readEdiDataValue('UNB', 4, 1);
            $datetime = \preg_replace('#(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)#', '20$1-$2-$3 $4:$5:00', $date . $time);

            return $datetime;
        }

        // common YYYYMMDDHHMM
        $datetime = $this->readEdiDataValue('UNB', 4);
        $datetime = \preg_replace('#(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)#', '$1-$2-$3 $4:$5:00', $datetime);

        return $datetime;
    }
1263072
protected function getDateTime()
    {
        $result = null;
        if ($this->attributeValue) {
            $valueObject = $this->getAttributeValue();
            if ($valueObject !== null) {
                $dateTime = $valueObject->getValue();
                if ($dateTime instanceof DateTime) {
                    $result = $dateTime;
                }
            }
        }

        return $result;
    }
920137
public function toASN1(): TimeType
    {
        $dt = $this->_dt;
        switch ($this->_type) {
            case Element::TYPE_UTC_TIME:
                return new UTCTime($dt);
            case Element::TYPE_GENERALIZED_TIME:
                // GeneralizedTime must not contain fractional seconds
                // (rfc5280 4.1.2.5.2)
                if ($dt->format("u") != 0) {
                    // remove fractional seconds (round down)
                    $dt = self::_roundDownFractionalSeconds($dt);
                }
                return new GeneralizedTime($dt);
        }
        throw new \UnexpectedValueException(
            "Time type " . Element::tagToName($this->_type) . " not supported.");
    }
1295009
public function convert($input)
    {
        if (!$input) {
            return;
        }

        if (!($input instanceof \DateTime)) {
            throw new UnexpectedValueException('Input must be DateTime object.');
        }

        return $input->format($this->outputFormat);
    }
1303889
protected function getValidTimestamp($value)
    {
        if (gettype($value) == 'integer') {
            return $value;
        }

        if ($value instanceof DateTime) {
            return $value->getTimestamp();
        }

        throw new UnexpectedValueException('Instance of DateTime required for a valid timestamp');
    }
811301
public String getTimexValue() {
    if (Timex3_Type.featOkTst && ((Timex3_Type)jcasType).casFeat_timexValue == null)
      jcasType.jcas.throwFeatMissing("timexValue", "de.unihd.dbs.uima.types.heideltime.Timex3");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Timex3_Type)jcasType).casFeatCode_timexValue);}
1059327
public function getTimestamp(): int
    {
        $supportedClasses = implode(
            ', ',
            [
                '\MongoTimestamp',
                '\MongoDate',
                '\MongoDB\BSON\Timestamp',
                '\MongoDB\BSON\UTCDateTime',
                '\DateTimeInterface',
            ]
        );

        if (!$this->t || !is_object($this->t)) {
            throw new \DomainException(
                'The timestamp to normalise must be one of ' . $supportedClasses . ' but it is not an object'
            );
        }

        switch (get_class($this->t)) {
            case 'MongoTimestamp':
                return (int) $this->t->__toString();

            case 'MongoDate':
                return $this->t->sec;

            case 'MongoDB\BSON\Timestamp':
                return $this->t->getTimestamp();

            case 'MongoDB\BSON\UTCDateTime':
                return (int) $this->t->toDateTime()->format('U');
        }

        if ($this->t instanceof \DateTimeInterface) {
            return $this->t->getTimestamp();
        }

        throw new \DomainException(
            'The normalised timestamp must be one of ' . $supportedClasses
        );
    }
352604
protected static function getTime() {
		$mtime = microtime();
		$mtime = explode(" ",$mtime); 
		$mtime = $mtime[1] + $mtime[0]; 
		return $mtime;
	}
214660
public function getExecutionTime()
    {
        if(!$this->getFinishedAt()) {
            $now = new \DateTime();
            return $now->getTimestamp() - $this->getCreatedAt()->getTimestamp();
        } else {
            return $this->getFinishedAt()->getTimestamp() - $this->getCreatedAt()->getTimestamp();
        }
    }
654944
public function getRenderer()
    {
        if (!$this->_renderer instanceof KTemplateHelperInterface)
        {
            // Make sure we have an identifier
            if(!($this->_renderer instanceof KObjectIdentifier)) {
                $this->setRenderer($this->_renderer);
            }

            $this->_renderer = $this->getObject($this->_renderer);

            if(!$this->_renderer instanceof ComActivitiesActivityRendererInterface)
            {
                throw new UnexpectedValueException(
                    'Renderer: '.get_class($this->_renderer).' does not implement ComActivitiesActivityRendererInterface'
                );
            }

            $this->_renderer->getTemplate()->registerFunction('url', array($this, 'getUrl'));
        }

        return $this->_renderer;
    }
1322228
public function getValueType()
	{
		if ( $this->Cardinality == XmlTypeCardinality::ZeroOrMore ||
			 $this->Cardinality == XmlTypeCardinality::OneOrMore )
			return "\lyquidity\XPath2\XPath2NodeIterator";

		if ( $this->IsNode )
			return "\lyquidity\xml\xpath\XPathNavigator";

		if ($this->Cardinality == XmlTypeCardinality::One)
			return $this->ItemType;

		return "object";
	}
939118
public function getValue()
    {
        if ($this->value instanceof \DateTime) {
            $this->value->setTimezone(new \DateTimeZone('UTC'));

            return $this->value->format('Y-m-d\TH:i:s\Z');
        }

        return $this->value;
    }
470661
public function getType()
    {
        $type = null;
        if (($parent = $this->getParent()) instanceof ElementHandler && $parent->hasAttribute(self::ATTRIBUTE_TYPE)) {
            $type = $parent->getAttribute(self::ATTRIBUTE_TYPE)->getValue(false, false);
        }
        return $type;
    }
1257113
final public static function now()
    {
        if (self::$now === null) {
            try {
                self::$now = new \DateTimeImmutable('now', self::tzUtc());
            } catch (\Exception $e) {
                return null;
            }
        }

        return self::$now;
    }
985286
protected function getAttributeFrom()
    {
        $attribute = array_get($this->formFieldData->options(), 'from', $this->formFieldData->source());

        if ( ! $attribute) {
            throw new UnexpectedValueException("DateRangeStrategy must have 'date_from' option set");
        }

        return $attribute;
    }