public function jsonSerialize()
    {
        if ($this->blnDateNull) {
            $dt = self::now();    // time only will use today's date.
            $dt->setTime($this);
        } else {
            $dt = clone $this;
        }

        if ($this->blnTimeNull) {
            return [
                QCubed::JSON_OBJECT_TYPE => 'qDateTime',
                'year' => $dt->Year,
                'month' => $dt->Month - 1,
                'day' => $dt->Day
            ];
        } else {
            return [
                QCubed::JSON_OBJECT_TYPE => 'qDateTime',
                'year' => $dt->Year,
                'month' => $dt->Month - 1,
                'day' => $dt->Day,
                'hour' => $dt->Hour,
                'minute' => $dt->Minute,
                'second' => $dt->Second
            ];
        }
    }
public function jsonSerialize()
    {
        if ($this->blnDateNull) {
            $dt = self::now();    // time only will use today's date.
            $dt->setTime($this);
        } else {
            $dt = clone $this;
        }

        if ($this->blnTimeNull) {
            return [
                QCubed::JSON_OBJECT_TYPE => 'qDateTime',
                'year' => $dt->Year,
                'month' => $dt->Month - 1,
                'day' => $dt->Day
            ];
        } else {
            return [
                QCubed::JSON_OBJECT_TYPE => 'qDateTime',
                'year' => $dt->Year,
                'month' => $dt->Month - 1,
                'day' => $dt->Day,
                'hour' => $dt->Hour,
                'minute' => $dt->Minute,
                'second' => $dt->Second
            ];
        }
    }
public function jsonSerialize ( ) { if ( $ this -> blnDateNull ) { $ dt = self :: now ( ) ; // time only will use today's date. $ dt -> setTime ( $ this ) ; } else { $ dt = clone $ this ; } if ( $ this -> blnTimeNull ) { return [ QCubed :: JSON_OBJECT_TYPE => 'qDateTime' , 'year' => $ dt -> Year , 'month' => $ dt -> Month - 1 , 'day' => $ dt -> Day ] ; } else { return [ QCubed :: JSON_OBJECT_TYPE => 'qDateTime' , 'year' => $ dt -> Year , 'month' => $ dt -> Month - 1 , 'day' => $ dt -> Day , 'hour' => $ dt -> Hour , 'minute' => $ dt -> Minute , 'second' => $ dt -> Second ] ; } }
Returns a datetime in a way that it will pass through a json_encode and be decodable in qcubed.js.
qcubed.unpackParams looks for this.

@return array|mixed;
Returns a datetime in a way that it will pass through a json_encode and be decodable in qcubed . js . qcubed . unpackParams looks for this .