Title: Show post date
Last modified: August 21, 2016

---

# Show post date

 *  Resolved [aled2305](https://wordpress.org/support/users/aled2305/)
 * (@aled2305)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/show-post-data/)
 * Hello, I’m using
 *     ```
       ?php if (have_posts()) : while (have_posts()) : the_post(); ?>
             <?php
           // Fetch most recent posts, limit to 1
       		$latest_posts = get_posts( array(
       			'posts_per_page' => 1,
       		) );
           // get first and only item in array
       		$latest_post  = $latest_posts[0];
       	?>
   
       	<div class="Ptitle"><h1><a href="<?php echo get_permalink( $latest_post->ID ); ?>"><?php echo $latest_post->post_title; ?></a></h1><h3><span class="entry-date"><?php echo get_the_date(); ?></span></h3></div>
          	<?php if ( has_excerpt( $latest_post ) ) : ?>
       	<p><?php echo $latest_post->post_excerpt; ?></p>
       	<p>
       	  <?php else : ?>
       	  <?php echo strip_shortcodes(wp_trim_words( $latest_post->post_content, 50 )); // '250' is number of words ?>
   
       	  <?php endif; ?>
   
       	  </p>
       	<p><a href="<?php echo get_permalink( $latest_post->ID ); ?>"> Read More...</a></p>
       ```
   
 * at the moment to show the most resent post and in the code I use
    `<span class
   ="entry-date"><?php echo get_the_date(); ?></span>` to show the post date, but
   it says 23 of Oct even though it was posted today (29 of Oct) and on the edit
   post page it says 29?
 * Can someone please help me resolve this! and look here if you’ve got time too.
 * [http://wordpress.org/support/topic/show-second-newest-post?replies=3](http://wordpress.org/support/topic/show-second-newest-post?replies=3)
 * Thanks

The topic ‘Show post date’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [date](https://wordpress.org/support/topic-tag/date/)
 * [month](https://wordpress.org/support/topic-tag/month/)
 * [template](https://wordpress.org/support/topic-tag/template/)
 * [time](https://wordpress.org/support/topic-tag/time/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [aled2305](https://wordpress.org/support/users/aled2305/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/show-post-data/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
