Save sqldateextract.php as sqldateformat.php.

If you want to display dates and times in different ways (as some users may struggle with the sensible SQL format) you can.  Replace the middle block of PHP code with this similar block:

$sqlResult=mysqli_query($dbconnection, "SELECT DATE_FORMAT(tasktime, '') AS formattedDate FROM task;");
echo "<p>Dates:</p>";
echo "<ul>";
while ($sqlRow=mysqli_fetch_array($sqlResult)){
    echo "<li>$formattedDate</li>";
echo "</ul>";

Try it and you get an empty list.  Find the empty pair of single quotes inside the query.  Place any number of these into those quotes (separate them with spaces or other characters if you want to):