The following line with the date and time is added using custom PHP code loaded by the Add Custom PHP plugin:

2024-05-28 01:39:20



This demo works as described below:

a) This article contains the text #DATE#.

b) The custom code is replacing this text with the current date. Here is the code:

$body = JResponse::getBody();
$body = str_replace('#DATE#', date("Y-m-d h:i:s"), $body);

This code is executed in every page of the demo. If the text #DATE# exists in that page then it is replaced by the date.

There are many ways a custom PHP code can be triggered in order to do something.