steinm Thu Mar 30 15:54:27 2006 UTC
Modified files: /phpdoc/en/reference/paradox/functions px-date2string.xml Log: - added much more documentaion including an example http://cvs.php.net/viewcvs.cgi/phpdoc/en/reference/paradox/functions/px-date2string.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/paradox/functions/px-date2string.xml diff -u phpdoc/en/reference/paradox/functions/px-date2string.xml:1.3 phpdoc/en/reference/paradox/functions/px-date2string.xml:1.4 --- phpdoc/en/reference/paradox/functions/px-date2string.xml:1.3 Fri Feb 10 16:27:34 2006 +++ phpdoc/en/reference/paradox/functions/px-date2string.xml Thu Mar 30 15:54:27 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. --> <refentry id="function.px-date2string"> <refnamediv> @@ -17,7 +17,12 @@ <methodparam><type>string</type><parameter>format</parameter></methodparam> </methodsynopsis> - &warn.undocumented.func; + <para> + Turns a date as it stored in the paradox file into human readable + format. Paradox dates are the number of days since 1.1.0000. + This function is just for convenience. It can be easily replaced by some + math and the calendar functions as demonstrated in the example below. + </para> </refsect1> <refsect1 role="parameters"> @@ -28,7 +33,8 @@ <term><parameter>pxdoc</parameter></term> <listitem> <para> - Resource identifier of the paradox database. + Resource identifier of the paradox database + as returned by <function>px_new</function>. </para> </listitem> </varlistentry> @@ -96,49 +102,51 @@ --> - <!-- Use when examples exist <refsect1 role="examples"> &reftitle.examples; <para> <example> - <title>A <function>px_timestamp2string</function> example</title> - <para> - Any text that describes the purpose of the example, or - what goes on in the example should go here (inside the - <example> tag, not out - </para> + <title>Turn a paradox date into a human readable form</title> <programlisting role="php"> <![CDATA[ <?php -if ($anexample === true) { - echo 'Use the PEAR Coding Standards'; -} +$px = px_new(); + +/* make up a date as it could be stored in */ +/* a date field of a paradox db. */ +/* 700000 days since 1.1.0000. */ +$days = 700000; + +/* Use the calendar functions to print a */ +/* human readable format of the date */ +echo jdtogregorian($days+1721425)."\n"; +/* px_date2string() outputs the same */ +echo px_date2string($px, $days, "n/d/Y")."\n"; + +px_delete($px); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ -Use the PEAR Coding Standards +7/15/1917 +7/15/1917 ]]> </screen> </example> </para> </refsect1> - --> - - <!-- Use when adding See Also links <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> - <member><function></function></member> - <member>Or <link linkend="somethingelse">something else</link></member> + <member><function>px_timestamp2string</function></member> + <member><function>jdtogregorian</function></member> </simplelist> </para> </refsect1> - --> </refentry>