fork download
  1. <?php
  2.  
  3. $date = "01-05-2017 08:00:00";
  4.  
  5. $date = new DateTime($date, new DateTimeZone("UTC"));
  6. $date->setTimeZone(new DateTimeZone("America/Sao_Paulo"));
  7.  
  8. echo $date->format('Y-m-d H:i:s'), PHP_EOL;
  9.  
Success #stdin #stdout 0.01s 83904KB
stdin
Standard input is empty
stdout
2017-05-01 05:00:00