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