New answers tagged

0

Resolved! This is a working php code to compare current date to article created date: $date1 = new DateTime(); $date2 = new DateTime($article->created); if ($date1 > $date2) echo $date1->format("Y-m-d") . " is latest than " . $date2->format("Y-m-d"); else echo $date1->format("Y-m-d") . " is older than " . $date2->format("...


0

I'll assume you're using an inline script inside a PHP file. Depending on how you're fetching the creation date of the article, you may need to make some minor modifications: // Get the creation date of the article // This may need to be changed according to your requirements $creationDate = $this->item->created; Joomla\CMS\Factory::getDocument()->...


Top 50 recent answers are included