php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25403 Problem with VT_DATE
Submitted: 2003-09-06 10:27 UTC Modified: 2003-09-07 11:33 UTC
From: m dot melloff at mptronic dot com Assigned:
Status: Wont fix Package: COM related
PHP Version: 4.3.2 OS: WindowsXP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: m dot melloff at mptronic dot com
New email:
PHP Version: OS:

 

 [2003-09-06 10:27 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-07 11:33 UTC] sniper@php.net
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/

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 20:01:26 2024 UTC