public function getDate()
    {
        if (false === $this->frontMatter->has('date')) {
            # Defaults to last modified
            return (new DateTime)->setTimestamp($this->file->getMTime());
        }

        $date = $this->frontMatter->getDate();

        if ($date instanceof DateTime) {
            return $date;
        }

        return (new DateTime)->setTimestamp($date);
    }
public function getDate()
    {
        if (false === $this->frontMatter->has('date')) {
            # Defaults to last modified
            return (new DateTime)->setTimestamp($this->file->getMTime());
        }

        $date = $this->frontMatter->getDate();

        if ($date instanceof DateTime) {
            return $date;
        }

        return (new DateTime)->setTimestamp($date);
    }
public function getDate ( ) { if ( false === $ this -> frontMatter -> has ( 'date' ) ) { # Defaults to last modified return ( new DateTime ) -> setTimestamp ( $ this -> file -> getMTime ( ) ) ; } $ date = $ this -> frontMatter -> getDate ( ) ; if ( $ date instanceof DateTime ) { return $ date ; } return ( new DateTime ) -> setTimestamp ( $ date ) ; }
Front matter date or filemtime

@return DateTime
Front matter date or filemtime