wordpress/wp-content/plugins/sqlite-integration/functions.php
/**
	 * Method to emulate MySQL DATE_ADD() function.
	 *
	 * This function adds the time value of $interval expression to $date.
	 * $interval is a single quoted strings rewritten by SQLiteQueryDriver::rewrite_query().
	 * It is calculated in the private function deriveInterval().
	 *
	 * @param string $date representing the start date.
	 * @param string $interval representing the expression of the time to add.
	 * @return string date formated as '0000-00-00 00:00:00'.
	 */


@param string $date representing the start date.
@param string $interval representing the expression of the time to add.
@param string $date representing the start date . @param string $interval representing the expression of the time to add .
public function date_add($date, $interval) {
		$interval = $this->deriveInterval($interval);
		switch (strtolower($date)) {
			case "curdate()":
				$objDate   = new Datetime($this->curdate());
				$objDate->add(new DateInterval($interval));
				$returnval = $objDate->format("Y-m-d");
				break;
			case "now()":
				$objDate   = new Datetime($this->now());
				$objDate->add(new DateInterval($interval));
				$returnval = $objDate->format("Y-m-d H:i:s");
				break;
			default:
				$objDate   = new Datetime($date);
				$objDate->add(new DateInterval($interval));
				$returnval = $objDate->format("Y-m-d H:i:s");
		}
		return $returnval;
	}
public function date_add ( $ date , $ interval ) { $ interval = $ this -> deriveInterval ( $ interval ) ; switch ( strtolower ( $ date ) ) { case " curdate() " : $ objDate = new Datetime ( $ this -> curdate ( ) ) ; $ objDate -> add ( new DateInterval ( $ interval ) ) ; $ returnval = $ objDate -> format ( " Y-m-d " ) ; break ; case " now() " : $ objDate = new Datetime ( $ this -> now ( ) ) ; $ objDate -> add ( new DateInterval ( $ interval ) ) ; $ returnval = $ objDate -> format ( " Y-m-d H:i:s " ) ; break ; default : $ objDate = new Datetime ( $ date ) ; $ objDate -> add ( new DateInterval ( $ interval ) ) ; $ returnval = $ objDate -> format ( " Y-m-d H:i:s " ) ; } return $ returnval ; }
Method to emulate MySQL DATE_ADD() function.
Method to emulate MySQL DATE_ADD () function .