get datetime in php code example
Example 1: php get current time and date
date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15
Example 2: php code to display current date and time in different formats
echo date('Y.m.d H:i:s');
date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15
echo date('Y.m.d H:i:s');