I am given a date string formatted like: May 11, 2017 4:27:00 AM PDT
which I need to convert with no hour shifting to 2017-05-11 16:27:00 .
I am working with
$myTime='May 11, 2017 4:27:00 AM PDT';
$formatted= date('Y-m-d H:i:s', strtotime($myTime));
This returns a time set 7 hours later due to the Unix time conversion. I can manually subtract 7 or 8 hours (depending on season PST or PDT) to get the result I need, but there must be a better way.