Classes/ViewHelpers/AbstractDvoContextApiViewHelper.php
protected function buildDateTimebyString($stringDate, $base = null)
    {
        if (is_null($base)) {
            $base = time();
        }

        try {
            $base = $base instanceof \DateTimeInterface ? $base->format('U') : strtotime((MathUtility::canBeInterpretedAsInteger($base) ? '@' : '') . $base);
            $dateTimestamp = strtotime((MathUtility::canBeInterpretedAsInteger($date) ? '@' : '') . $date, $base);
            $date = new \DateTime('@' . $dateTimestamp);
            $date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
        } catch (\Exception $exception) {
            throw new Exception('"' . $date . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1241722579);
        }
    }
protected function buildDateTimebyString($stringDate, $base = null)
    {
        if (is_null($base)) {
            $base = time();
        }

        try {
            $base = $base instanceof \DateTimeInterface ? $base->format('U') : strtotime((MathUtility::canBeInterpretedAsInteger($base) ? '@' : '') . $base);
            $dateTimestamp = strtotime((MathUtility::canBeInterpretedAsInteger($date) ? '@' : '') . $date, $base);
            $date = new \DateTime('@' . $dateTimestamp);
            $date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
        } catch (\Exception $exception) {
            throw new Exception('"' . $date . '" could not be parsed by \DateTime constructor: ' . $exception->getMessage(), 1241722579);
        }
    }
protected function buildDateTimebyString ( $ stringDate , $ base = null ) { if ( is_null ( $ base ) ) { $ base = time ( ) ; } try { $ base = $ base instanceof \ DateTimeInterface ? $ base -> format ( 'U' ) : strtotime ( ( MathUtility :: canBeInterpretedAsInteger ( $ base ) ? '@' : '' ) . $ base ) ; $ dateTimestamp = strtotime ( ( MathUtility :: canBeInterpretedAsInteger ( $ date ) ? '@' : '' ) . $ date , $ base ) ; $ date = new \ DateTime ( '@' . $ dateTimestamp ) ; $ date -> setTimezone ( new \ DateTimeZone ( date_default_timezone_get ( ) ) ) ; } catch ( \ Exception $ exception ) { throw new Exception ( '"' . $ date . '" could not be parsed by \DateTime constructor: ' . $ exception -> getMessage ( ) , 1241722579 ) ; } }
Build a DateTime of a String

@param string $stringDate
@param mixed $base
@return \DateTimeInterface
@throws Exception
Build a DateTime of a String