1
Following the documentation, I am trying to represent the date in the following format:
2017-01-07T11:20:00-03:00
Code:
$dt = $_POST['data-emissao'];
$date = new DateTime($dt, new DateTimeZone('America/Sao_Paulo'));
$data= $date->format("Y-m-d\TH:i:sP");
echo $data;
and I’m getting:
2017-01-07T13:32:00-02:00
Reference: http://php.net/manual/en/datetime.settimezone.php