a small amount of code, but not so much as to alter other commands

without changing php.ini or another permanent but more difficult solution
please tell me how to change

date('l jS \of F Y h:i:s A')

add more code to change to eastern standard time zone

works but
not my code I just want to create one command to see if code is continuously working

would alter the log file which I didnt create
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Not 100% sure I understand the question, but this might be a strategy.  You can retrieve the current settings with date_default_timezone_get().  Save this value in a variable.  Then set the Eastern time zone, recover the formatted date() and store the date string in a variable.  Then set the original timezone back.
<?php // demo/temp_rgb192.php

 * http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28663001.html

function other_date($z = 'America/New_York', $p = 'l jS \of F Y h:i:s A')
    $d = date_default_timezone_get();
    $r = date($p);
    return $r;

echo '<pre>';
echo PHP_EOL . "LOCAL: " . date('c');
echo PHP_EOL . other_date();
echo PHP_EOL . "LOCAL: " . date('c');

Open in new window

rgb192Author Commented:
so this function sets the local time and then sets it back to whatever time that code had previously
Ray PaseurCommented:
Yes, that's the idea.  I tested it quite a few times and it seemed to work correctly - never lost a second!  It could, in theory, lose a second, but it did not happen to me yet.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgb192Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.