Horde_Date::toJson PHP Method

toJson() public method

Formats date and time to the ISO format used by JSON.
public toJson ( ) : string
return string Date and time.
    public function toJson()
    {
        return $this->format(self::DATE_JSON);
    }

Usage Example

 /**
  * Returns a simple object suitable for json transport representing this
  * object.
  *
  * Possible properties are:
  * - t: type
  * - i: interval
  * - e: end date
  * - c: count
  * - d: data
  * - co: completions
  * - ex: exceptions
  *
  * @return object  A simple object.
  */
 public function toJson()
 {
     $json = new stdClass();
     $json->t = $this->recurType;
     $json->i = $this->recurInterval;
     if ($this->hasRecurEnd()) {
         $json->e = $this->recurEnd->toJson();
     }
     if ($this->recurCount) {
         $json->c = $this->recurCount;
     }
     if ($this->recurData) {
         $json->d = $this->recurData;
     }
     if ($this->completions) {
         $json->co = $this->completions;
     }
     if ($this->exceptions) {
         $json->ex = $this->exceptions;
     }
     return $json;
 }
All Usage Examples Of Horde_Date::toJson