Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have this line of code :

$registration_date = get_the_time('F j, Y').' at '.get_the_time('g:i a');

I just ran this on my BlueHost hosted website and it returned : January 29, 2013 at 12:54 pm

However, on the same site I can see in the dashboard that post publication dates are correct.

share|improve this question
    
Can you describe the problem more clearly... –  Vinod Dalvi Apr 11 '13 at 12:00
    
Yes. The problem is that today is not 29th of January :) the get_the_time('F j, Y') call should return today's date. –  drake035 Apr 11 '13 at 12:08
add comment

1 Answer

up vote 4 down vote accepted

get_the_time() function returns the time of the current post within loop.

If you want to display today's date then use date function of core php.

share|improve this answer
add comment

Your Answer

 
discard

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.