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.

  • Can you describe the problem more clearly... 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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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