The best way to do this would be with a function... you can add an include to the top of all your pages such as corefuncs.php is what I like to use and then I include all my functions on what page.
Here's a couple of functions I wrote - you may need to modify the delimiters to get the display exactly as you want it.
The first one is what I use to convert standard date format (mm/dd/yyyy) into database format (yyyy-mm-dd):
// DATABASE DATE CONVERSION (ASSUMES DATE FORMAT IS MM/DD/YYYY)
function databaseDate($datetoconvert) {
$dateDataDate = explode('/', $datetoconvert);
$dateDataYear = $dateDataDate[2];
$dateDataMonth = $dateDataDate[0];
$dateDataDay = $dateDataDate[1];
$dataDateFinal = $dateDataYear.'-'.$dateDataMonth.'-'.$dateDataDay;
return $dataDateFinal;
}
This works by first setting the input of a date field to only accept mm/dd/yyyy through validation... then on the actual database update field, modify the data like this: databaseDate($_POST['datefield']
Remember that the function page include must occur before you call the function which is why I typically will call my functions in the first line of every page before anything else.
For the display, it works the same, but I use this function:
// DATE FUNCTION
function displayDate($datetochange) {
if ($datetochange != "0000-00-00") {
$date_var = strtotime($datetochange);
echo date('m/d/Y', $date_var);
} else {
echo '';
}
}
So, now just call the function and then use it like this:
<?php displayDate($row_WADAhomework['due_date']); ?>
In your case, you may want to modify that function's formatting from m/d/Y to read m-d-Y.
Best regards,
Brian