From bcad40a05ab2dc2a341a3227e30b96668bce4500 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 9 Jun 2005 16:34:40 +0000 Subject: New Import --- modules/xmlrpc/doc/helpers.html | 318 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 modules/xmlrpc/doc/helpers.html (limited to 'modules/xmlrpc/doc/helpers.html') diff --git a/modules/xmlrpc/doc/helpers.html b/modules/xmlrpc/doc/helpers.html new file mode 100644 index 00000000..4f0c1319 --- /dev/null +++ b/modules/xmlrpc/doc/helpers.html @@ -0,0 +1,318 @@ +Helper functions
XML-RPC for PHP: version 1.1
PrevNext

Chapter 6. Helper functions

Table of Contents
Date functions
Easy use with PHP arrays
Debugging aids

XML-RPC for PHP contains some helper functions which you can + use to make processing of XML-RPC requests easier.

Date functions

The XML-RPC specification has this to say on dates:

Don't assume a timezone. It should be specified by the server in its + documentation what assumptions it makes about timezones.

Unfortunately, this means that date processing isn't + straightforward. Although XML-RPC uses ISO 8601 format dates, it + doesn't use the timezone specifier.

We strongly recommend that in every case where you pass + dates in XML-RPC calls, you use UTC (GMT) as your timezone. Most computer + languages include routines for handling GMT times natively, and + you won't have to translate between timezones.

For more information about dates, see ISO 8601: The Right Format for Dates, which has a handy link to a PDF of the ISO 8601 specification. Note that XML-RPC uses exactly one of the available representations: CCYYMMDDTHH:MM:SS.

iso8601_encode

$isoString=iso8601_encode($time_t, $utc=0);

Returns an ISO 8601 formatted date generated from the + UNIX timestamp $time_t, as returned by + the PHP function time().

The argument $utc can be omitted, + in which case it defaults to 0. If it is + set to 1, then the function corrects the + time passed in for UTC. Example: if you're in the GMT-6:00 + timezone and set $utc, you will receive + a date representation six hours ahead of your local + time.

The included demo program vardemo.php + includes a demonstration of this function.

iso8601_decode

$time_t=iso8601_decode($isoString, $utc=0);

Returns a UNIX timestamp from an ISO 8601 encoded time and + date string passed in. If $utc is + 1 then $isoString is + assumed to be in the UTC timezone, and thus the + $time_t result is also UTC: otherwise, + the timezone is assumed to be your local timezone and you receive a local timestamp.


PrevHomeNext
xmlrpc_server Easy use with PHP arrays
\ No newline at end of file -- cgit