Skip to content

Instantly share code, notes, and snippets.

@stefano-rs
Last active March 15, 2016 18:29
Show Gist options
  • Save stefano-rs/e62d9c4a4f205d155e21 to your computer and use it in GitHub Desktop.
Save stefano-rs/e62d9c4a4f205d155e21 to your computer and use it in GitHub Desktop.
Gerando DateTime
<?php
$time_zone = new DateTimeZone('America/Sao_Paulo');
$now = new DateTime();
$now->setTimezone($time_zone);
echo $timestring = $now->format('Y-m-d H:i:s');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment