static public function toDate($value=null)
    {
        if (!$value) {
            return date('Y-m-d');
        } else {
            if(is_numeric($value)) {
                // strftime format is different from date()
                //$value = strftime('%Y-%m-%d %H:%M:%S', $value);
                $value = strftime('%Y-%m-%d', $value);
            }
            
            return $value;
        }
    }
static public function toDate($value=null)
    {
        if (!$value) {
            return date('Y-m-d');
        } else {
            if(is_numeric($value)) {
                // strftime format is different from date()
                //$value = strftime('%Y-%m-%d %H:%M:%S', $value);
                $value = strftime('%Y-%m-%d', $value);
            }
            
            return $value;
        }
    }
static public function toDate ( $ value = null ) { if ( ! $ value ) { return date ( 'Y-m-d' ) ; } else { if ( is_numeric ( $ value ) ) { // strftime format is different from date() //$value = strftime('%Y-%m-%d %H:%M:%S', $value); $ value = strftime ( '%Y-%m-%d' , $ value ) ; } return $ value ; } }
to date like '2010-01-01'
@param  mixed  $value
@return string
to date like 2010 - 01 - 01