Link to home
Start Free TrialLog in
Avatar of gingera
gingera

asked on

PHP: How to convert local time to another time zone?

Hello,

How do I convert local time to another time zone?

time() gives the current local time. How do I manipulate it to time in another time zone?
ASKER CERTIFIED SOLUTION
Avatar of mmarth
mmarth

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gingera
gingera

ASKER

Thanks mmarth. Because of daylight saving in different parts of the world, the time offset may change during the year. So your suggested solution needs manual changing when daylight saving starts and ends.

Is there a better solution that uses
date_default_timezone_set("America/New_York"); to convert local time to New York time?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gingera

ASKER

Thanks for your help.