RE: [SOAP] problem with SOAP's date/time type
| From: | Javier Muniz | Date: | Fri, 03 Oct 2003 17:06:28 +0000 |
| Subject: | RE: [SOAP] problem with SOAP's date/time type | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1099@lists.php.net to get a copy of this message | ||
Hmmm, I'm actually having problems going in the other direction. I have a
unix timestamp that I'm getting via PEAR::Date's getTime function, and
putting that into a dateTime type like so:
$soap_date = new SOAP_Type_dateTime($date->getTime())
Then I return it as a dateTime in my SOAP method via:
return new SOAP_Value('time','dateTime',$soap_date->toString())
And the resulting timestamp is always one hour ahead of the actual time.
Now at first I thought this problem had to do with SOAP's dateTime type, but
then I discovered that doing the same thing with the Date object like:
$test_date = new Date($date->getTime())
Also yielded the same result. Now I'm wondering it if it's a problem with
getTime(). I'm going to do a little desk check today and see if I can get
to the bottom of it.
-Javier
-----Original Message-----
From: Mike Carter [mailto:mikeatwork@ukonline.co.uk]
Sent: Friday, October 03, 2003 2:09 AM
To: 'Javier Muniz'; soap@lists.php.net
Subject: RE: [SOAP] problem with SOAP's date/time type
> -----Original Message-----
> From: Javier Muniz [mailto:jmuniz@granicus.com]
>
> It looks like the dateTime type in the SOAP library might be
> reporting times an hour ahead of the actual time. Can
> someone else verify this? Want to make sure it's not
> something wrong with my install/setup.
Yes I've struggled with this for half a year... And nobody really said
anything when I posted about it here :-(
However, I've kinda got it sorted now (I think). It all depends on how you
go about using the class to convert from UTC->timestamp.
This works:-
$dateTimeObj = new SOAP_Type_dateTime; $_SESSION['auth']['ldate'] =
$dateTimeObj->toUnixtime($User->LastLoginDateTime);
Regards,
Mike c
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security service
working around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________