#25403 [Opn->WFx]: Problem with VT_DATE
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 15:33:39 +0000 |
| Subject: | #25403 [Opn->WFx]: Problem with VT_DATE | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47185@lists.php.net to get a copy of this message | ||
ID: 25403
Updated by: sniper@php.net
Reported By: m dot melloff at mptronic dot com
-Status: Open
+Status: Wont fix
Bug Type: COM related
Operating System: WindowsXP
PHP Version: 4.3.2
New Comment:
The com extension has been completely rewritten in PHP5 and the PHP4
com extension is no longer being maintained. If you find bugs with the
com extension in PHP5 please report them.
Latest PHP 5 snapshot can be found at http://snaps.php.net/
Previous Comments:
------------------------------------------------------------------------
[2003-09-06 10:27:50] m dot melloff at mptronic dot com
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 this bug report at http://bugs.php.net/?id=25403&edit=1