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; andpublished— 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:
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: