Display the date of the page

<?php echo $this->date(); ?>

If you want to change the format of the date, you can pass it as the first parameter of the method like this:

<?php echo $this->date('%A, %e %B %Y'); ?>

The default date returned is the page’s creation date. If you want to display the last updated time of this page write this:

<?php echo $this->date('%a, %e %b %Y', 'updated'); ?>

Other values that can be used instead of updated are:

  • created — (default) which returns the date the page was initially stored in the database, no matter what “Status” it had; and
  • published — which returns the date the page was first saved with the “Status” set to “Published”

For more information about the date format, check this site: http://php.net/strftime

How to translate every date in your layout

Set the locale to your language with the setlocale PHP function:

<?php setlocale(LC_ALL, 'fr_CA.utf8'); ?>

For more information about this function check this site: http://php.net/setlocale


Frog CMS Demo

Public front end website click here
Administration backend click here

Opensource.com admin login info:
login: admin
password: demo123

Help us!

If you use and like Frog CMS, then please consider making a donation.


Click here to lend your support to: Frog CMS and make a donation at www.pledgie.com !