Codex tools: Log in / create account
Displays or returns the date of a post, or a set of posts if published on the same day.
This tag must be used within The Loop.
<?php the_date('format', 'before', 'after', echo); ?>
Displays the date using defaults.
<p>Date posted: <?php the_date(); ?></p>
Displays the date using the '2007-07-23' format (ex: 2004-11-30), inside an <h2> tag.
<?php the_date('Y-m-d', '<h2>', '</h2>'); ?>
Returns the date in the default format inside an <h2> tag and assigns it to the $my_date variable. The variable's value is then displayed with the PHP echo command.
<?php $my_date = the_date('', '', '', FALSE); echo $my_date; ?>
the_date_xml, the_date, the_time, the_modified_date, the_modified_time, get_the_time, single_month_title, get_calendar, the_weekday, the_weekday_date
You are viewing a mobilized version of this site...
View original page here