From:             m dot melloff at mptronic dot com
Operating system: WindowsXP
PHP version:      4.3.2
PHP Bug Type:     COM related
Bug description:  Problem with VT_DATE

Description:
------------
Problem when retrieving a VT_DATE in a COM object if the date is < to
01/01/1970

the code works fine with with any date > 01/01/1970 

the problem is VT_Date can start at 01/01/1901 and $DOB->Value returns a
timestamp starting from 1970 instead of 1901. While it makes easy to
format the VT_Date with Date($format,$timestamp) it does not alow to
retrieve dates < 1970 from a COM:VT_Date variable

for VT_Date < 1970 (year) ,$DOB->Value return -1 ...







Reproduce code:
---------------
$query = new COM("DICOMobjects.DICOMQuery") ;
//settings to Query the Dicom Server"
$query->node="localhost";
$query->port="104";
$query->CallingAE="Client";
$query->CalledAE="Server";
$query->Name="*"; //tell the query to return any patient

$result = $query->DoQuery;//starts the query
$results = $query->Count;//number of items returned

for($i=1;$i<$results+1;$i++) 
{
    $Attrib=$answer->Attributes;
    $DOB = $Attrib->ItemByIndex(4);//Date of birth of the patient
    echo $DOB->value."<br>"; //is a VT_Date an returns a Timestamp
    echo date("d/m/Y",$DOB->value)."<br>"; //formats the timestamp

}

Expected result:
----------------
the returned timestamp should not be -1 for dates < 1970
that makes the date unaccessible , and even for dates>1970 the timestamp
should be given from 1901 and not 1970 like it is now

Actual result:
--------------
A timestamp starting from 1901 and not 1970.

Please help me :p

-- 
Edit bug report at http://bugs.php.net/?id=25403&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25403&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25403&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25403&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25403&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25403&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25403&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25403&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25403&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25403&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25403&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25403&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25403&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25403&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25403&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25403&r=gnused

Reply via email to