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

        if ($this->blnTimeNull) {
            return sprintf('new Date(%s, %s, %s)', $dt->Year, $dt->Month - 1, $dt->Day);
        } else {
            return sprintf('new Date(%s, %s, %s, %s, %s, %s)', $dt->Year, $dt->Month - 1, $dt->Day, $dt->Hour,
                $dt->Minute, $dt->Second);
        }
    }