|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32115 dateTime encoding of timezone incorrect
Submitted: 2005-02-25 22:22 UTC Modified: 2005-03-05 14:28 UTC
From: rtroll at yahoo-inc dot com Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5CVS-2005-02-25 OS: *
Private report: No CVE-ID:
 [2005-02-25 22:22 UTC] rtroll at yahoo-inc dot com
It looks like PHP's encoding of a dateTime value is incorrectly encoding the timezone.  For example, encoding unix time:


results in


instead of:


The timezone offset must contain a colon, according to

Section Timezones

Reproduce code:
$WSDL = "";
$client = new SoapClient( $WSDL, array( "trace" => true,
                                        "exceptions" => 0,
function dump_xml( $title, $body )
    $nl = preg_replace( "/\>\</", ">\n<", $body );
    $clean = htmlspecialchars( $nl );
    print "\n<b>$title</b>\n<pre>$clean</pre>\n";
$t = time();
$r = $client->dateInfo( array( 'dtval' => $t ) );
$dateTime_pst = strftime( "%Y-%m-%dT%H:%M:%S-08:00", time() ); # Works 'cause server is in PST zone
$dateTime_utc = gmstrftime( "%Y-%m-%dT%H:%M:%SZ", time() );
echo "<h2>Bug</h2>Request should have converted unix timestamp [$t] to xs:dateTime string [$dateTime_utc] or [$dateTime_pst].  Instead, request is:<br>\n";

dump_xml( "Request", $client->__getLastRequest() );

Expected result:
Request should be similiar to:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="urn:yahoo:platform:soap:demo:full">

Actual result:
Request is currently:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="urn:yahoo:platform:soap:demo:full">


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-05 14:28 UTC]
Fixed in CVS (HEAD and PHP_5_0).
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Oct 09 20:01:33 2015 UTC