DibiVariableInterface example

time = time(); // current time elseif (is_string($time)) $this->time = strtotime($time); // try convert to timestamp else $this->time = (int) $time; } /** * Format for SQL * * @param object destination DibiDriver * @param string optional modifier * @return string */ public function toSQL($driver, $modifier = NULL) { return $driver->format($this->time, dibi::FIELD_DATETIME); // format according to driver's spec. } } // CHANGE TO REAL PARAMETERS! dibi::connect(array( 'driver' => 'sqlite', 'database' => 'sample.sdb', )); // generate and dump SQL dibi::test(" INSERT INTO [mytable]", array( 'A' => 12, 'B' => NULL, 'C' => new MyDateTime(31542), // using out class 'D' => 'any string', ));