php - How to convert UTC timezone to user-defined TimezoneGet the solution ↓↓↓
PHP's DateTime object is pretty flexible.
$UTC = new DateTimeZone("UTC"); $newTZ = new DateTimeZone("America/New_York"); $date = new DateTime( "2011-01-01 15:00:00", $UTC ); $date->setTimezone( $newTZ ); echo $date->format('Y-m-d H:i:s');
You can always change your default timezone to user's timezone using location:
Share solution ↓
Link To Answer People are also looking for solutions of the problem: fastcgi sent in stderr: "primary script unknown" while reading response header from upstream
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.