php code to insert current date into mysql database code example Example: php get current datetime mysql format date('Y-m-d H:i:s');