how to create datetime using date and time in php code example Example: php datetime create $date = DateTime::createFromFormat('d-m-Y', '15-12-2020');