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);
        }
    }
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);
        }
    }
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 ) ; } }
Convert the object to a javascript object. This is code that if executed in javascript would produce a Date
javascript object. Note that the date will be created in the browser's local timezone, so convert to the
browser's timezone first if that is important for you.

@return string
Convert the object to a javascript object . This is code that if executed in javascript would produce a Date javascript object . Note that the date will be created in the browser s local timezone so convert to the browser s timezone first if that is important for you .