how to get currrent date and time in php code example Example: php get current time and date date("Y-n-j G:i:s"); //-->2020-10-29 23:27:15