Jump to content

Show time in different timezone


mhewall

Recommended Posts

My webserver is hosted in England and I'm in the US.  So all the time is showing up a couple hours ahead of my timezone.  I can't edit the php.ini file or none of that so I was wondering how would I go about changing the php scripts on my pages to display the time and date as EST.  At 11 PM my time Saturday may 19 it said it was "Sunday May 20, 4:00 am"  So I can't just do something that changes that hour, I need it to display the correct date aswell.

 

I need it to be the Date and Time in New York (5 hour difference)  So if anyone can help me I would really appricate at.

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/52232-show-time-in-different-timezone/
Share on other sites

just +5 hours on the output!

 

How would I do that?  This is the code that is showing the date/time

echo date("l F j, Y, h:i:s A"); 

 

 

 

<?php

ini_set("date.timezone", "America/New_York");

// Rest of code here

?>

 

A list of other timezones can be found at http://www.php.net/manual/en/timezones.php

I tired that, it did not work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.