Is there a PHP function that returns the date and time in the same format as the MySQL function NOW()?
NOW()
I know how to do it using date(), b
date()
I was looking for the same answer, and I have come up with this solution for PHP 5.3 or later:
$dtz = new DateTimeZone("Europe/Madrid"); //Your timezone $now = new DateTime(date("Y-m-d"), $dtz); echo $now->format("Y-m-d H:i:s");