How Do I Change This?

by 5 replies
6
I would like to change this code to EST (not military) but can't figure it out. "F j, Y, g:i" - The date part is fine, which I believe is the "F j, Y," but I can't get the time to do what I want it to do. Right now, it's 4:49pm EST where I'm at. Can anyone please shed some light on this?

Regards,

Fruzz
#programming #change
  • Try this code:

    $dateTime = new DateTime("now", new DateTimeZone('EST'));
    echo $dateTime->format("F j, Y, g:i");
    • [1] reply
    • Thank you very much for your response. The time still doesn't work correctly. It shows the way I want it to show, but doesn't show the correct time - EST.
  • You mean you just want to add EST to the end of it? or the time isn't converting?
    • [1] reply

    • The time isn't converting.
      • [1] reply

Next Topics on Trending Feed

  • 6

    I would like to change this code to EST (not military) but can't figure it out. "F j, Y, g:i" - The date part is fine, which I believe is the "F j, Y," but I can't get the time to do what I want it to do. Right now, it's 4:49pm EST where I'm at. Can anyone please shed some light on this? Regards,