This function allows you to switch between SQL (YYYY-MM-DD) and "human-readable" (DD/MM/YYYY) date formats at the speed of light. No calculations, only string manipulation !

function switchDF($date) {
    $s = array("-", "/");
    for ($i=0;$i<count($s);$i++) {
        $date = explode($s[$i], $date);
        if (count($date) == 3) return $date[2].$s[(int)!$i].$date[1].$s[(int)!$i].$date[0];
        else $date = $date[0];
    }
    return false;
}