| 148 | | /** |
|---|
| 149 | | * @see ResultSetCommon::getDate() |
|---|
| 150 | | */ |
|---|
| 151 | | public function getDate($column, $format = '%X') |
|---|
| 152 | | { |
|---|
| 153 | | /* As of PHP 5.2.4, strftime() returns false for '0000-00-00' which |
|---|
| 154 | | is impossible to tell apart from illegal dates. (Pre-PHP 5.2.4 |
|---|
| 155 | | even interpreted such dates incorrectly, see |
|---|
| 156 | | http://bugs.php.net/bug.php?id=41523). |
|---|
| 157 | | We catch this special case and return null as the date here. |
|---|
| 158 | | However, we need to know the exact format the DBMS returns this |
|---|
| 159 | | date, which is why we make this decision here in the specific |
|---|
| 160 | | driver before dispatching to the common implementation. */ |
|---|
| 161 | | $idx = (is_int($column) ? $column - 1 : $column); |
|---|
| 162 | | if (array_key_exists($idx, $this->fields) && $this->fields[$idx] == '0000-00-00') return null; |
|---|
| 163 | | return parent::getDate($column, $format); |
|---|
| 164 | | } |
|---|
| 165 | | |
|---|
| | 173 | |
|---|
| | 174 | /** |
|---|
| | 175 | * @see ResultSetCommon::getDate() |
|---|
| | 176 | */ |
|---|
| | 177 | public function getDate($column, $format = '%X') |
|---|
| | 178 | { |
|---|
| | 179 | /* As of PHP 5.2.4, strftime() returns false for '0000-00-00' which |
|---|
| | 180 | is impossible to tell apart from illegal dates. (Pre-PHP 5.2.4 |
|---|
| | 181 | even interpreted such dates incorrectly, see |
|---|
| | 182 | http://bugs.php.net/bug.php?id=41523). |
|---|
| | 183 | We catch this special case and return null as the date here. |
|---|
| | 184 | However, we need to know the exact format the DBMS returns this |
|---|
| | 185 | date, which is why we make this decision here in the specific |
|---|
| | 186 | driver before dispatching to the common implementation. */ |
|---|
| | 187 | $idx = (is_int($column) ? $column - 1 : $column); |
|---|
| | 188 | if (array_key_exists($idx, $this->fields) && $this->fields[$idx] == '0000-00-00') return null; |
|---|
| | 189 | return parent::getDate($column, $format); |
|---|
| | 190 | } |
|---|