|  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 (profile)
Status: Closed Package: SOAP related
PHP Version: 5CVS-2005-02-25 OS: *
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: rtroll at yahoo-inc dot com
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 14:01:31 2024 UTC