Hello,
Is there any PHP function that returns time format as the MySQL fuction NOW()
I know how to do it using date() .. but I am asking if there is a function only for this.
e.g.
"2009-12-01 00:00:00"
Hello,
Is there any PHP function that returns time format as the MySQL fuction NOW()
I know how to do it using date() .. but I am asking if there is a function only for this.
e.g.
"2009-12-01 00:00:00"
date('Y-m-d H:i:s')
Look here for more details: http://pl.php.net/manual/en/function.date.php
There actually is a function exactly for this. Its called MySQL_NOW()
. There is only one thing you have to do to get access to this PHP function.
Put this at the bottom of your script:
function MySQL_NOW(){ return date('Y-m-d H:i:s'); }
In reality, PHP, as with many other languages, doesn't like to create many functions with a specific program in mind. Those are reserved for libraries. So, if the function isn't in the php.net/mysql library, it probably doesn't exist.
No there is no built-in equivalent of Date() function in PHP. You can only use date() function.