$idx = (is_int($column) ? $column - 1 : $column);
if (!array_key_exists($idx, $this->fields)) { throw new SQLException("Invalid resultset column: " . $column); }
if ($this->fields[$idx] === null) { return null; }
$ts = strtotime($this->fields[$idx]);
if ($ts === -1
$ts === false) { // in PHP 5.1 return value changes to FALSE
return null; //Alex Jackson change.... so that 0000-00-00
//the following is the original
//throw new SQLException("Unable to convert value at column " . $column . " to timestamp: " . $this->fields[$idx]);
}
if ($format === null) {
return $ts;
}
if (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}
Change History
Download in other formats:

Since 1998, Sensio Labs has been promoting the Open-Source software
movement by providing quality web application development, training,
consulting. Sensio Labs also supports several large
Open-Source projects.
|