Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.