Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Bug #10206 Timezone in Type/dateTime.php not converted correctly
Submitted: 2007-02-27 13:01 UTC
From: jan dot ehrlich at uni-passau dot de Assigned: cweiske
Status: Closed Package: SOAP (version 0.10.1)
PHP Version: 4.4.4 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2007-02-27 13:01 UTC] jan dot ehrlich at uni-passau dot de (Jan Ehrlich)
Description: ------------ On line 97 in the function toString the timezone is converted with the default PHP convert string O . This is false. The PHP use for timezone the pattern +0200 , but the XSD defines the pattern +02:00 (see http://www.w3.org/TR/xmlschema-2/#dateTime-timezones). The source code should be modified to be XSD compatible. Test script: --------------- You should add following function: /** * Converts PHP timezone String to XSD compatible timezone String. * see http://www.w3.org/TR/xmlschema-2/#dateTime-timezones * @param string $timeZoneStr a PHP timezone string * @return string An XSD compatible timezone string */ function timeZoneToXSD($timeZoneStr) { if(strlen($timeZoneStr)!=5) { return $timeZoneStr; } return substr($timeZoneStr,0,3) . ":" . substr($timeZoneStr,3,2); } and substitute the line 97 with following: return date('Y-m-d\TH:i:s', $timestamp) . $this->timeZoneToXSD(date('O', $timestamp)) ;

Comments

 [2007-06-27 15:55 UTC] cweiske (Christian Weiske)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.