General
Getting Support
Administration
Design
Wolf Reference
Plugin Development
Core Development
- Design documents
- Working guidelines
- References
Press, Graphics and Translations
Wolf CMS books section
date()
To display the date a page was created, use:
<?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'); ?>
For more information about the date format, check the PHP manual for strftime.
On Windows, and rarely in other settings, the use of %e may prevent any date appearing! In this case, use %d in its place. (See PHP Bugs for more information, the date howto for a work-around.)
Values
The default date returned is the page’s creation date. The dates which can be displayed are:
- created — (default) which returns the date the page was initially stored in the database, no matter what “Status” it had;
- published — which returns the date the page was first saved with the “Status” set to “Published”; and
- updated — which returns the most recent date on which that page was altered (this can include re-ordering)
Example
For example, if you want to display the last updated time of this page, use this:
<?php echo $this->date('%a, %e %b %Y', 'updated'); ?>
