php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47006 ibase.timeformat won't work when any of %H %M %S missing
Submitted: 2009-01-05 11:04 UTC Modified: 2009-12-23 01:00 UTC
From: marrtins at hackers dot lv Assigned:
Status: No Feedback Package: InterBase related
PHP Version: 5.2.8 OS: Linux 2.6.14.4
Private report: No CVE-ID: None
 [2009-01-05 11:04 UTC] 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
*/

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-08 17:54 UTC] lester at lsces dot co dot uk
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.
 [2009-08-13 09:30 UTC] jani@php.net
Please provide the information Lester asked for.
 [2009-08-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-12-15 01:03 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-12-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC