note 33971 added to function.date
| From: | steven at actsofvolition dot com | Date: | Sat, 12 Jul 2003 14:26:56 +0000 |
| Subject: | note 33971 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51963@lists.php.net to get a copy of this message | ||
The ISO 8601 timeformat required in XML-RPC needs a colon in the time zone offset (-05:00 vs.
-0500). However, the time zone offset output "O" in PHP doesn't add the colon.
A simple (if messy) workaround:
// Output timezones in iso-8601 format.
$tz = date("O",sqldate($postdate));
$tz = substr($tz,0,3).':'.substr($tz,3);
echo date("Y-m-d\TH:i:s",sqldate($postdate)).$tz;
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33971
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33971&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33971&report=yes