ID:               47006
 Comment by:       lester at lsces dot co dot uk
 Reported By:      marrtins at hackers dot lv
 Status:           Open
 Bug Type:         InterBase related
 Operating System: Linux 2.6.14.4
 PHP Version:      5.2.8
 New Comment:

I've worked my way through this and can't find a problem, even putting
minutes and hours the wrong way around is working fine on both Linux and
Windows. Please can you supply a database and the actual script so I can
see if I can recreate it here.


Previous Comments:
------------------------------------------------------------------------

[2009-01-05 11:04:44] marrtins at hackers dot lv

Description:
------------
Get wrong time values into database when missing %S in
ibase.timeformat, like: ini_set('ibase.timeformat', "%H:%M");

Firebird 2.1.1.17910
EXECUTION_DATE = Date field
EXECUTION_TIME = Time field

ibase_execute($q, "15:00", 670); - FAILD
ibase_execute($q, 15 * 3600, 670); - OK

Reproduce code:
---------------
<?php

ini_set('ibase.timeformat', "%H:%M");
ini_set('ibase.dateformat', "%d.%m.%Y");
ini_set('ibase.timestampformat', "%d.%m.%Y %H:%M");

ibase_connect($_CONF['DB']['LOCAL']['HOST'],
$_CONF['DB']['LOCAL']['USER'], $_CONF['DB']['LOCAL']['PASS'], "UTF8");

$q = ibase_prepare("UPDATE ORDERS SET EXECUTION_TIME = ? WHERE ID =
?");
ibase_execute($q, "15:00", 670);

$q = ibase_query("SELECT EXECUTION_DATE, EXECUTION_TIME FROM ORDERS
WHERE ID = 670");
$r = ibase_fetch_object($q);

print_r($r);


Expected result:
----------------
stdClass Object
(
    [EXECUTION_DATE] => 05.01.2009
    [EXECUTION_TIME] => 15:00
)


Actual result:
--------------
stdClass Object
(
    [EXECUTION_DATE] => 05.01.2009
    [EXECUTION_TIME] => 31:00
)
/*
When adding IBASE_UNIXTIMES flag, like:
$r = ibase_fetch_object($q, IBASE_UNIXTIMES);
then [EXECUTION_TIME] => -1
*/


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47006&edit=1

Reply via email to