Title: php echo the_time(&#039;Y&#039;)
Last modified: August 20, 2016

---

# php echo the_time('Y')

 *  Resolved [Ramzii](https://wordpress.org/support/users/ramzii/)
 * (@ramzii)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/php-echo-the_timey/)
 * This php code should generate the current year were living in right?
 * `<?php echo the_time('Y');?>`
 * But it still gives 2012?
 * I think it has something to do with the hosting server.. any clue? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Phil](https://wordpress.org/support/users/owendevelopment/)
 * (@owendevelopment)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/php-echo-the_timey/#post-3421650)
 * Try this:
 *     ```
       <?php echo date("Y")?>
       ```
   
 * the_time references the publish time of the post/page and gives inconsistent 
   values when used outside loops. the_date should be used in templates/footers 
   etc.
 *  Thread Starter [Ramzii](https://wordpress.org/support/users/ramzii/)
 * (@ramzii)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/php-echo-the_timey/#post-3421658)
 * I love you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘php echo the_time('Y')’ is closed to new replies.

## Tags

 * [the_time](https://wordpress.org/support/topic-tag/the_time/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Ramzii](https://wordpress.org/support/users/ramzii/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/php-echo-the_timey/#post-3421658)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
