|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-07 11:33 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 02:00:02 2025 UTC |
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