php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47263 xmlrpc_set_type() doesn't respect timezone settings
Submitted: 2009-02-01 16:12 UTC Modified: 2009-02-03 19:02 UTC
From: daniel dot oconnor at gmail dot com Assigned:
Status: Closed Package: XMLRPC-EPI related
PHP Version: 5.2.8 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel dot oconnor at gmail dot com
New email:
PHP Version: OS:

 

 [2009-02-01 16:12 UTC] daniel dot oconnor at gmail dot com
Description:
------------
xmlrpc_set_type() doesn't appear to respect my timezone settings 

(alternatively, it should parse everything as GMT/UTC?)

Tested on 5.2.6 & 5.2.8

Reproduce code:
---------------
<?php
date_default_timezone_set('UTC');

$time = time();
$date = date("Y-m-dTH:i:s", $time) . "\n";
$date = "20060116T19:14:03";
$time = strtotime($date);

print $date . "\n";
print $time . "\n";

$xmlrpc_date = (string)$date;

xmlrpc_set_type($xmlrpc_date, 'datetime');
print $xmlrpc_date->timestamp . "\n";;

print date("Y-m-d H:i:s", $time) . "\n";
print date("Y-m-d H:i:s", $xmlrpc_date->timestamp);

/* 5.2.6 / ubuntu says:
20060116T19:14:03
1137438843
1137401043
2006-01-16 19:14:03
2006-01-16 08:44:03
*/

Expected result:
----------------
20060116T19:14:03
1137438843
1137438843
2006-01-16 19:14:03
2006-01-16 19:14:03

Actual result:
--------------
20060116T19:14:03
1137438843
1137401043
2006-01-16 19:14:03
2006-01-16 08:44:03

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-02 21:29 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-02-02 23:43 UTC] daniel dot oconnor at gmail dot com
Windows: working happily now


C:\>php -v
PHP 5.2.9-dev (cli) (built: Feb  2 2009 11:39:58)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

C:\>php 147263.php
20060116T19:14:03
1137438843
1137438843
2006-01-16 19:14:03
2006-01-16 19:14:03
C:\>
 [2009-02-03 19:02 UTC] iliaa@php.net
Works fine on *nix as well...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC