Re: [SOAP] SOAP dateTime conversion class problem
| From: | Shane Caraveo | Date: | Mon, 19 May 2003 17:07:41 +0000 |
| Subject: | Re: [SOAP] SOAP dateTime conversion class problem | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-611@lists.php.net to get a copy of this message | ||
It's likely a locale or daylight issue, not certain what to do about it.
Shane
Mike Carter wrote:
Hi, Executing your code here on the Windows based PHP server.. 2003-05-15T23:00:00Z soap_type_datetime Object ([ereg_iso8601] =>(-?[0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]* )?(Z|[+\-][0-9]{4}|[+\-][0-9]{2}:[0-9]{2})?[timestamp] => 1052953200) 15/05/2003 Looks like it is adding nearly 2 days to the UTC returned from the SOAP server? Is this some screw up related to daylight savings time / British summer time ? -- and if so, why does it add 2 days rather than an hour? Any thoughts? :-/ Regards, Mike C.-----Original Message----- From: Shane Caraveo [mailto:shane@caraveo.com] Sent: 18 May 2003 02:23 To: Mike Carter Cc: soap@lists.php.net Subject: Re: [SOAP] SOAP dateTime conversion class problem Hi Mike, If I do this: $time = new SOAP_Type_dateTime("2003-05-14T00:00:00.0000000+01:00"); print $time->toUTC()."\n"; print_r($time); print date("d/m/Y", $time->timestamp); I get the output: 2003-05-14T23:00:00Z soap_type_datetime Object ([ereg_iso8601] => ... [timestamp] => 1052953200) 14/05/2003 Also you can do $this->_test("2003-05-14T00:00:00.0000000+01:00"); It seems correct to me. Are you saying you get 15/05/2003? That would be very odd. Shane Mike Carter wrote:Hi, I seem to be having a few problems with the SOAP dateTime class. I pass in the XML time string "2003-05-14T00:00:00.0000000+01:00" $time = new SOAP_Type_dateTime($entry->EventDate); The Unix timestamp returned is:- soap_type_datetime Object ( [ereg_iso8601] => (-?[0-9]{4})-([0-9]{2})-([0-9]{2}).....blah [timestamp] => 1052953200 ) Doing date("d/m/Y", $time->timestamp) doesn't display the correct date, it's a day in advance of the original 14/05/2003 ! Any idea what could be going on here? Regards, Mike C.