Get published date.

@param array $frontmatter with details on dates.

@return integer as time for publish time.
547518
private function getPublishTime($frontmatter)
    {
        list(, $date) = $this->di->get("view")->getPublishedDate($frontmatter);
        return strtotime($date);
    }
1116094
public function isPublish(PublishableReadInterface $object, \DateTimeInterface $currentDate = null)
    {
        $publish = $object->isPublishable();
        if ($publish && $object instanceof PublishStartReadInterface) {
            $publish = $this->isPublishStart($object, $currentDate);
        }
        if ($publish && $object instanceof PublishEndReadInterface) {
            $publish = $this->isPublishNotEnd($object, $currentDate);
        }

        return $publish;
    }
636231
public function getIsUnPublishScheduled()
    {
        if (!$this->owner->UnPublishOnDate) {
            return false;
        }
        $now = DBDatetime::now()->getTimestamp();
        $unpublish = $this->owner->dbObject('UnPublishOnDate')->getTimestamp();

        return $now < $unpublish;
    }
1349602
public function published($as='')
	{
		if (!$this->get('publish_up') || $this->get('publish_up') == '0000-00-00 00:00:00')
		{
			$this->set('publish_up', $this->get('created'));
		}

		$as = strtolower($as);

		if ($as)
		{
			if ($as == 'date')
			{
				return Date::of($this->get('publish_up'))->toLocal(Lang::txt('DATE_FORMAT_HZ1'));
			}

			if ($as == 'time')
			{
				return Date::of($this->get('publish_up'))->toLocal(Lang::txt('TIME_FORMAT_HZ1'));
			}

			return Date::of($this->get('publish_up'))->toLocal($as);
		}

		return $this->get('publish_up');
	}
1346501
public function getPublishedAtString()
    {
        setlocale(LC_TIME, 'fr_FR');

        if ($this->publishedAt) {
            return $this->publishedAtString = strftime('%d %B %Y', $this->publishedAt->getTimestamp());
        } else {
            return '';
        }
    }
656609
public static function get_published( array $mf, $ensurevalid = false, $fallback = null ) {
		return self::get_datetime_property( 'published', $mf, $ensurevalid, $fallback );
	}
732450
public static function toDbFormat($format = "Y-m-d H:i:s", $timestamp = null)
    {
        if ($timestamp === null) {
            $timestamp = time();
        }
        return date($format, $timestamp);
    }
621086
private function CheckPublished()
    {
        return PublishDateUtil::IsPublishedNow($this->article->GetPublish(), 
                $this->article->GetPublishFrom(), $this->article->GetPublishTo());
    }
1292040
public function isPublished()
	{
		$time = time();
		$published = ($this->published && ($this->publicationStart == '' || $this->publicationStart < $time) && ($this->publicationStop == '' || $this->publicationStop > $time));
		return $published;
	}
571029
function getFirstLastDate($dateA, $dFormat = "Y/m/d") {

//    $fDate = $lDate = date("m/d/y",time());
        $fDate = $lDate = date($dFormat, time());
        asort($dateA); // TODO
        $i = 0;
        $maxItem = count($dateA);
        foreach ($dateA as $k => $one) {
            if ($i == 0)
                $firstDate = $k;
            if ($i == $maxItem - 1)
                $lastDate = $k;
            $i++;
        }
        $fDate = date($dFormat, strtotime($firstDate));
        $lDate = date($dFormat, strtotime($lastDate));
        return array($fDate, $lDate);
    }
786688
private function getFrontmatter($file)
    {
        $basepath = $this->config["basePath"];
        $filter1  = $this->config["textfilter-frontmatter"];
        $filter2  = $this->config["textfilter-title"];
        $filter = array_merge($filter1, $filter2);
        
        $path = $basepath . "/" . $file;
        $src = file_get_contents($path);
        $filtered = $this->di->get("textfilter")->parse($src, $filter);
        return $filtered->frontmatter;
    }
1225722
protected function render_published_time(): string
    {
        return '<time class="published entry-date" itemprop="datePublished" datetime="'.
           \esc_attr(\get_the_date('Y-m-d\TH:i:sO', $this->post->get())).'">'.
           \get_the_time(\get_option('time_format'), $this->post->get()).
        '</time>';
    }
741735
public function setPublishDate($dateFormat = 'F d, Y')
	{
		$name_separate = explode('-', $this->getFileName(), 4);
		$originalDate = $name_separate[0] . '-' . $name_separate[1] . '-' .$name_separate[2];
		$this->publishDate = date($dateFormat, strtotime($originalDate));
	}
311715
public function getStartTime($precision = 0, $floatingPrecision = 3, $showUnit = true)
    {
        return $this->getFormattedTime($this->startTime, $precision, $floatingPrecision, $showUnit);
    }
672321
public function isPublishNotEnd(PublishEndReadInterface $object, \DateTimeInterface $currentDate = null)
    {
        $endDate = $object->getPublishEndDate();
        $currentDate = $currentDate ?: new \DateTime();

        return null === $endDate || $currentDate < $endDate;
    }
807327
public function get_prev_day($daytimestamp) {
        $date = new \DateTime();
        $date->setTimestamp($daytimestamp);
        $date->modify('-1 day');

        return $date->getTimestamp();
    }
951234
public static function diffFormatter($formatter = null)
    {
        if ($formatter === null) {
            // Use the static property defined in chronos.
            if (static::$diffFormatter === null) {
                static::$diffFormatter = new RelativeTimeFormatter();
            }

            return static::$diffFormatter;
        }

        return static::$diffFormatter = $formatter;
    }