"Fossies" - the Fresh Open Source Software Archive

Member "phpgroupware-0.9.16.017/xmlrpc/doc/helpers.html" (7 Aug 2001, 4893 Bytes) of package /linux/www/old/phpgroupware-0.9.16.017.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <HTML
    2 ><HEAD
    3 ><TITLE
    4 >Helper functions</TITLE
    5 ><META
    6 NAME="GENERATOR"
    7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
    8 "><LINK
    9 REV="MADE"
   10 HREF="edd@usefulinc.com"><LINK
   11 REL="HOME"
   12 TITLE="XML-RPC for PHP"
   13 HREF="index.html"><LINK
   14 REL="PREVIOUS"
   15 TITLE="xmlrpc_server"
   16 HREF="xmlrpc-server.html"><LINK
   17 REL="NEXT"
   18 TITLE="Easy use with PHP arrays"
   19 HREF="arrayuse.html"></HEAD
   20 ><BODY
   21 CLASS="CHAPTER"
   22 BGCOLOR="#FFFFFF"
   23 TEXT="#000000"
   24 LINK="#0000FF"
   25 VLINK="#840084"
   26 ALINK="#0000FF"
   27 ><DIV
   28 CLASS="NAVHEADER"
   29 ><TABLE
   30 WIDTH="100%"
   31 BORDER="0"
   32 CELLPADDING="0"
   33 CELLSPACING="0"
   34 ><TR
   35 ><TH
   36 COLSPAN="3"
   37 ALIGN="center"
   38 >XML-RPC for PHP: version 1.0b9</TH
   39 ></TR
   40 ><TR
   41 ><TD
   42 WIDTH="10%"
   43 ALIGN="left"
   44 VALIGN="bottom"
   45 ><A
   46 HREF="xmlrpc-server.html"
   47 >Prev</A
   48 ></TD
   49 ><TD
   50 WIDTH="80%"
   51 ALIGN="center"
   52 VALIGN="bottom"
   53 ></TD
   54 ><TD
   55 WIDTH="10%"
   56 ALIGN="right"
   57 VALIGN="bottom"
   58 ><A
   59 HREF="arrayuse.html"
   60 >Next</A
   61 ></TD
   62 ></TR
   63 ></TABLE
   64 ><HR
   65 ALIGN="LEFT"
   66 WIDTH="100%"></DIV
   67 ><DIV
   68 CLASS="CHAPTER"
   69 ><H1
   70 ><A
   71 NAME="HELPERS"
   72 >Chapter 6. Helper functions</A
   73 ></H1
   74 ><DIV
   75 CLASS="TOC"
   76 ><DL
   77 ><DT
   78 ><B
   79 >Table of Contents</B
   80 ></DT
   81 ><DT
   82 ><A
   83 HREF="helpers.html#AEN688"
   84 >Date functions</A
   85 ></DT
   86 ><DT
   87 ><A
   88 HREF="arrayuse.html"
   89 >Easy use with PHP arrays</A
   90 ></DT
   91 ><DT
   92 ><A
   93 HREF="debugging.html"
   94 >Debugging aids</A
   95 ></DT
   96 ></DL
   97 ></DIV
   98 ><P
   99 >XML-RPC for PHP contains some helper functions which you can
  100             use to make processing of XML-RPC requests easier.</P
  101 ><DIV
  102 CLASS="SECT1"
  103 ><H1
  104 CLASS="SECT1"
  105 ><A
  106 NAME="AEN688"
  107 >Date functions</A
  108 ></H1
  109 ><P
  110 >The XML-RPC specification has this to say on dates:</P
  111 ><A
  112 NAME="AEN691"
  113 ></A
  114 ><BLOCKQUOTE
  115 CLASS="BLOCKQUOTE"
  116 ><P
  117 >Don't assume a timezone. It should be specified by the server in its
  118                  documentation what assumptions it makes about timezones. </P
  119 ></BLOCKQUOTE
  120 ><P
  121 >Unfortunately, this means that date processing isn't
  122                 straightforward. Although XML-RPC uses ISO 8601 format dates, it
  123                 doesn't use the timezone specifier.</P
  124 ><P
  125 >We strongly recommend that in every case where you pass
  126                 dates in XML-RPC calls, you use UTC (GMT) as your timezone. Most computer
  127                 languages include routines for handling GMT times natively, and
  128                 you won't have to translate between timezones.</P
  129 ><P
  130 >For more information about dates, see <A
  131 HREF="http://www.uic.edu/year2000/datefmt.html"
  132 TARGET="_top"
  133 >ISO 8601: The Right Format for Dates</A
  134 >, 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.</P
  135 ><DIV
  136 CLASS="SECT2"
  137 ><H2
  138 CLASS="SECT2"
  139 ><A
  140 NAME="ISO8601ENCODE"
  141 >iso8601_encode</A
  142 ></H2
  143 ><DIV
  144 CLASS="FUNCSYNOPSIS"
  145 ><A
  146 NAME="AEN699"
  147 ></A
  148 ><P
  149 ></P
  150 ><P
  151 ><CODE
  152 ><CODE
  153 CLASS="FUNCDEF"
  154 >$isoString=iso8601_encode</CODE
  155 >($time_t, $utc=0);</CODE
  156 ></P
  157 ><P
  158 ></P
  159 ></DIV
  160 ><P
  161 >Returns an ISO 8601 formatted date generated from the
  162                     UNIX timestamp <TT
  163 CLASS="PARAMETER"
  164 ><I
  165 >$time_t</I
  166 ></TT
  167 >, as returned by
  168                     the PHP function <TT
  169 CLASS="FUNCTION"
  170 >time()</TT
  171 >. </P
  172 ><P
  173 >The argument <TT
  174 CLASS="PARAMETER"
  175 ><I
  176 >$utc</I
  177 ></TT
  178 > can be omitted,
  179                     in which case it defaults to <TT
  180 CLASS="LITERAL"
  181 >0</TT
  182 >. If it is
  183                     set to <TT
  184 CLASS="LITERAL"
  185 >1</TT
  186 >, then the function corrects the
  187                     time passed in for UTC. Example: if you're in the GMT-6:00
  188                     timezone and set <TT
  189 CLASS="PARAMETER"
  190 ><I
  191 >$utc</I
  192 ></TT
  193 >, you will receive
  194                     a date representation six hours ahead of your local
  195                     time.</P
  196 ><P
  197 >The included demo program <TT
  198 CLASS="FILENAME"
  199 >vardemo.php</TT
  200 >
  201                     includes a demonstration of this function.</P
  202 ></DIV
  203 ><DIV
  204 CLASS="SECT2"
  205 ><H2
  206 CLASS="SECT2"
  207 ><A
  208 NAME="ISO8601DECODE"
  209 >iso8601_decode</A
  210 ></H2
  211 ><DIV
  212 CLASS="FUNCSYNOPSIS"
  213 ><A
  214 NAME="AEN717"
  215 ></A
  216 ><P
  217 ></P
  218 ><P
  219 ><CODE
  220 ><CODE
  221 CLASS="FUNCDEF"
  222 >$time_t=iso8601_decode</CODE
  223 >($isoString, $utc=0);</CODE
  224 ></P
  225 ><P
  226 ></P
  227 ></DIV
  228 ><P
  229 >Returns a UNIX timestamp from an ISO 8601 encoded time and
  230                     date string passed in. If <TT
  231 CLASS="PARAMETER"
  232 ><I
  233 >$utc</I
  234 ></TT
  235 > is
  236                     <TT
  237 CLASS="LITERAL"
  238 >1</TT
  239 > then <TT
  240 CLASS="PARAMETER"
  241 ><I
  242 >$isoString</I
  243 ></TT
  244 > is
  245                     assumed to be in the UTC timezone, and thus the
  246                     <TT
  247 CLASS="PARAMETER"
  248 ><I
  249 >$time_t</I
  250 ></TT
  251 > result is also UTC: otherwise,
  252                     the timezone is assumed to be your local timezone and you receive a local timestamp.</P
  253 ></DIV
  254 ></DIV
  255 ></DIV
  256 ><DIV
  257 CLASS="NAVFOOTER"
  258 ><HR
  259 ALIGN="LEFT"
  260 WIDTH="100%"><TABLE
  261 WIDTH="100%"
  262 BORDER="0"
  263 CELLPADDING="0"
  264 CELLSPACING="0"
  265 ><TR
  266 ><TD
  267 WIDTH="33%"
  268 ALIGN="left"
  269 VALIGN="top"
  270 ><A
  271 HREF="xmlrpc-server.html"
  272 >Prev</A
  273 ></TD
  274 ><TD
  275 WIDTH="34%"
  276 ALIGN="center"
  277 VALIGN="top"
  278 ><A
  279 HREF="index.html"
  280 >Home</A
  281 ></TD
  282 ><TD
  283 WIDTH="33%"
  284 ALIGN="right"
  285 VALIGN="top"
  286 ><A
  287 HREF="arrayuse.html"
  288 >Next</A
  289 ></TD
  290 ></TR
  291 ><TR
  292 ><TD
  293 WIDTH="33%"
  294 ALIGN="left"
  295 VALIGN="top"
  296 >xmlrpc_server</TD
  297 ><TD
  298 WIDTH="34%"
  299 ALIGN="center"
  300 VALIGN="top"
  301 >&nbsp;</TD
  302 ><TD
  303 WIDTH="33%"
  304 ALIGN="right"
  305 VALIGN="top"
  306 >Easy use with PHP arrays</TD
  307 ></TR
  308 ></TABLE
  309 ></DIV
  310 ></BODY
  311 ></HTML
  312 >