To get current date and time in PHP, you can use the date function which returns the current timestamp according to the defined format.
echo date("Y-m-d H:i:s");
This prints current date and time in MySQL datetime format.
To get current date and time in PHP, you can use the date function which returns the current timestamp according to the defined format.
echo date("Y-m-d H:i:s");
This prints current date and time in MySQL datetime format.
Leave a Reply