• <?php echo date("F j Y"); ?>

    That’s the code I’m using to integrate into my header to display the CURRENT date. As of right now it’s 9:04 PM EST on NOVEMBER 2 2013, but it’s displaying NOVEMBER 3 2013 instead. Is this due to a time-zone issue, wrong code or simply wordpress not displaying the right date?

    Any help is appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s probably returning UTC time for some reason. Try this and see if it makes any difference.

    <?php date_default_timezone_set('America/New_York'); ?><?php echo date("F j, Y"); ?>
    Thread Starter teckn1caLity

    (@teckn1cality)

    Will do. I’ll have to test it once it’s 9pm EST it’ll change the date prematurely so if it doesn’t then that means this code will work. Thanks.

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

The topic ‘Get Current Date For Theme’ is closed to new replies.