WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Within a loop, that otherwise works fine, the_time() is giving me a date and time about 25 days and a few hours ahead of the actual date.
For instance, if I post today, it lists it as "April 30th, 2013" (today is April 6th, 2013).

I can't for the life of me figure out why it's doing this.

A couple things: This is on the front-end of my site and I am looping through a users posted attachments (sort of like a front-end media manager). The loop is working fine to grab the thumbnail, the attached post (and it's date), etc but the time of the actual upload of the file is just not right.

That being said, the date/time that lists in the wp-admin section is correct, which is even more confusing...

Pastebin of the entire page

share|improve this question
up vote 4 down vote accepted

if I post today, it lists it as April 30th, 2013 (today is April 6th, 2013).

Your using a lowercase t in your date format string.

t   Number of days in the given month   28 through 31 

On Line 92:

echo get_the_time('M-t-y \a\t g:ha' , $id);

I think you meant to use d or j instead.

share|improve this answer
Great catch! That was the issue alright, thanks for noticing that. – Eckstein Apr 7 '13 at 16:21

If this is on a VPS or a dedicated server, I would advise you take a look at your server's settings and adjust the time accordingly.
PHP gets the time from the system so this might be a simple case of misconfigured time on the server side.

share|improve this answer
Always check the code before suggesting configuration settings. 99% of the time the code is wrong. – Chris_O Apr 7 '13 at 10:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.