mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
- added much more documentaion including an example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@210411 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7f5a619952
commit
d23e009219
1 changed files with 28 additions and 20 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue