Title: The_time Value?
Last modified: August 18, 2016

---

# The_time Value?

 *  Resolved [digitalburn](https://wordpress.org/support/users/digitalburn/)
 * (@digitalburn)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/the_time-value/)
 * Hello there,
 * I was trying to get my index page to display the date and then show all posts
   for that day under it. So it might look like this:
 * January 17
    Post 1 Post 1 Text here Post 2 Post 2 Text here
 * January 16
    ect.
 * I thought this would be an easy way to do it. In my template header page I put
   in this code:
 * <?
    $newtime = the_time(‘F jS, Y’); if ($newtime !== $lastname){ ?> <div class
   =”post”> <?php echo(“$newtime”); $lastname = $newtime; ?> </div> <?}?>
 * But all it does is print out the date doesn’t even put it in the post divs. So
   I think this line “$newtime = the_time(‘F jS, Y’);” is just printing out the 
   date.
 * Is there any way to accomplish what I’m after? I guess I would just need the 
   value of the_time function, unless someone had a better way. Thanks!

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

 *  Thread Starter [digitalburn](https://wordpress.org/support/users/digitalburn/)
 * (@digitalburn)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/the_time-value/#post-319949)
 * Ok I figured it out! It’s get_the_time(). Sorry about about that. Those post 
   tags work way better than the search.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/the_time-value/#post-319950)
 * It’s very simple: use the_date instead of the_time.
    (see the Codex: [Template_Tags/the_date](http://codex.wordpress.org/Template_Tags/the_date)

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

The topic ‘The_time Value?’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/the_time-value/#post-319950)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
