system/classes/Collection.php
protected function compare2($a, $b, $descending = false)
    {
        $key = $this->sortKey;
        $aValue = $this->getValue($a, $key);
        $bValue = $this->getValue($b, $key);
        echo $aValue->format('m/d/Y')." - ".$bValue->format('m/d/Y')." - ";
        if ($aValue == $bValue) {
            return 0;
        }
        if ($descending == true) {
            echo (($aValue > $bValue) ? -1 : 1)."<br>";
            return ($aValue > $bValue) ? -1 : 1;
        }
        else {
            echo (($aValue > $bValue) ? 1 : -1)."<br>";
            return ($aValue > $bValue) ? 1 : -1;
        }
    }
protected function compare2($a, $b, $descending = false)
    {
        $key = $this->sortKey;
        $aValue = $this->getValue($a, $key);
        $bValue = $this->getValue($b, $key);
        echo $aValue->format('m/d/Y')." - ".$bValue->format('m/d/Y')." - ";
        if ($aValue == $bValue) {
            return 0;
        }
        if ($descending == true) {
            echo (($aValue > $bValue) ? -1 : 1)."<br>";
            return ($aValue > $bValue) ? -1 : 1;
        }
        else {
            echo (($aValue > $bValue) ? 1 : -1)."<br>";
            return ($aValue > $bValue) ? 1 : -1;
        }
    }
A simple compare function which is used by the Sort method.

@param $a Mixed
@param $b Mixed
@return boolean