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()
There is no built-in PHP now() function, but you can do it using date().
now()
Example
function now() { return date('Y-m-d H:i:s'); }
You can use date_default_timezone_set() if you need to change timezone.
date_default_timezone_set()
Otherwise you can make use of Carbon - A simple PHP API extension for DateTime.