toUTC()

From: Date: Tue, 15 Jul 2003 15:43:59 +0000
Subject: toUTC()
Groups: php.soap 
Request: Send a blank email to php-soap+get-805@lists.php.net to get a copy of this message
Hi Guys I’m trying to pass the time of appointments and record entry dates over a web service to a .Net server. When sending out the values, I convert the date to Unix timestamp using mktime(0,0,0,$month,$day,$year); I then pass this timestamp into toUTC() as a method of SOAP_Type_dateTime. They receive the wrong time – the wrong time which is out by anything from an hour to 47 hours. The fault is definitely PHP’s because they can do it at will between their servers. Upon receiving the DateTime from a C# web service, I have to first strip out the ‘+01:00’ which tells you which timezone you are in and therefore adds an hour to whatever time you had. I often find that even though they sent me the same date at midnight (i.e. the first thing that morning), I get back a time that is somewhere between 1 hour and 3 years wrong (yes you read it right). I have had entries that seemed to be the right dates until you noticed that they were in 2000. Is there anything that can be done so that I don’t have to hack away at my code stripping things out of the UTC thing that I get back and have usable dates? The string that represents the UTC date from C# looks like this: 2003-07-18T00:00:00.0000000+01:00 and the outgoing date looks like this: 2003-07-15T23:00:00Z and while I’m at it, why is the conversion always 23:00:00 of the same day when I told it 00:00:00 when I created the timestamp? Please help someone – this is creating so much work every time I want to parse a date Regards Steve Fisk --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.492 / Virus Database: 291 - Release Date: 24/06/2003 ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________

« previous php.soap (#805) next »