If you have access to PHP 5.3, the intl extension is very nice for doing things like this.
Here's an example from the manual:
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
'America/Los_Angeles',IntlDateFormatter::GREGORIAN );
$fmt->format(0); //0 for current time/date
In your case, you can do:
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
'America/New_York');
$fmt->format($datetime); //where $datetime may be a DateTime object, an integer representing a Unix timestamp value (seconds since epoch, UTC) or an array in the format output by localtime().
As you can set a Timezone such as America/New_York
, this is much better than using a GMT or UTC offset, as this takes into account the day light savings periods as well.
Finaly, as the intl extension uses ICU data, which contains a lot of very useful features when it comes to creating your own date/time formats.