convert to UTC without changing php timezone settings
How can I convert the time zone of a date string in php without changing the default time zone. I want to convert it locally to display only. The php time zone settting should not be modified. EDIT: My source time is a UTC string, I want to convert it to a different format, retaining the time zone as UTC, but php is converting it to local timezone. The code I used was: date('Y-m-d H:i::s',strtotime($time_str)); How do I retain timezone? $src_tz = new DateTimeZone('America/Chicago'); $dest_tz = new DateTimeZone('America/New_York'); $dt = new DateTime("2000-01-01 12:00:00", $src_tz); $dt-