Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   How Do I Change This? (https://www.warriorforum.com/programming/375469-how-do-i-change.html)

SShip 4th May 2011 02:50 PM

How Do I Change This?
 
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

ToneUK 4th May 2011 03:54 PM

Re: How Do I Change This?
 
Try this code:

$dateTime = new DateTime("now", new DateTimeZone('EST'));
echo $dateTime->format("F j, Y, g:i");

SShip 4th May 2011 05:19 PM

Re: How Do I Change This?
 
1 Attachment(s)
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.

stma 4th May 2011 06:26 PM

Re: How Do I Change This?
 
You mean you just want to add EST to the end of it? or the time isn't converting?

SShip 4th May 2011 06:28 PM

Re: How Do I Change This?
 
Quote:

Originally Posted by stma (Post 3826941)
You mean you just want to add EST to the end of it? or the time isn't converting?


The time isn't converting.

SShip 4th May 2011 06:35 PM

Re: How Do I Change This?
 
1 Attachment(s)
Here's an example: I just posted this test and it's 8:30pm EST when I did it (which is what I'm looking for). I've posted an image for you to see, it says 12:30am in the thread, way off from what I'm looking to get.

Thanks for your help.


All times are GMT -6. The time now is 01:01 AM.