|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-03-23 18:34 UTC] lester at lsces dot co dot uk
[2019-03-23 20:13 UTC] lester at lsces dot co dot uk
[2021-03-31 11:39 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2021-03-31 11:39 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ The interbase.so extension parses dates that have two digit years wrong. In php.ini, ibase.dateformat = "%m/%d/%Y" I am able to get correct results by editing function ibase_query.c, function _php_ibase_bind, forcing "#ifdef HAVE_STRPTIME" to fail, which causes firebird sql to to parse the string. This does not fail on my Windows boxes. Test script: --------------- CREATE TABLE Z_DEBUG ( FID INTEGER, FDATE DATE ); CREATE OR ALTER TRIGGER Z_DEBUG_BI0 FOR Z_DEBUG ACTIVE BEFORE INSERT POSITION 0 AS BEGIN NEW.FID = NEXT VALUE FOR GEN_MYGEN; END <?php ibase_connect('localhost:TEST', 'sysdba', 'masterkey'); $q = ibase_query("INSERT INTO Z_DEBUG (FDATE) VALUES(?) RETURNING (FID)", '3/6/17'); $r = ibase_fetch_object($q); $q2 = ibase_query("SELECT FDATE, extract(year from FDATE) as FYEAR FROM Z_DEBUG WHERE FID = ?", $r->FID); $r2 = ibase_fetch_object($q2); print $r2->FDATE . ' ' . $r2->FYEAR . "\n\n"; Expected result: ---------------- 03/06/2017 2017 Actual result: -------------- 03/06/17 17 That is the year 0017, 17 years after 1 BC