update DateFormatter docs

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@254550 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Stanislav Malyshev 2008-03-07 22:46:02 +00:00
parent 0ca81b1b17
commit 4814d83662
21 changed files with 561 additions and 428 deletions

View file

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<section xml:id="intl.dateformatter-constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.constants;
<para>
TODO
These constants are used to specify different formats
in the constructor for DateType and TimeType.
<variablelist>
<varlistentry>
<term>
@ -12,7 +13,7 @@ TODO
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Do not include this element</simpara>
</listitem>
</varlistentry>
<varlistentry>
@ -21,7 +22,7 @@ TODO
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Completely specified style (Tuesday, April 12, 1952 AD or 3:30:42pm PST)</simpara>
</listitem>
</varlistentry>
<varlistentry>
@ -30,7 +31,7 @@ TODO
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Long style (January 12, 1952 or 3:30:32pm)</simpara>
</listitem>
</varlistentry>
<varlistentry>
@ -39,7 +40,7 @@ TODO
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Medium style (Jan 12, 1952)</simpara>
</listitem>
</varlistentry>
<varlistentry>
@ -48,16 +49,27 @@ TODO
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Most abbreviated style, only essential data (12/13/52 or 3:30pm)</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<section xml:id="intl.dateformatter-constants.calendartypes">
<para>
The following int constants are used to specify the calendar.
These calendars are all based directly on the Gregorian calendar.
Non-Gregorian calendars need to be specified in locale.
Examples might include locale="hi@calendar=BUDDHIST".
<variablelist>
<varlistentry>
<term>
<constant>DateFormatter::TRADITIONAL</constant>
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Non-Gregorian Calendar</simpara>
</listitem>
</varlistentry>
<varlistentry>
@ -66,12 +78,12 @@ TODO
(<type>string</type>)
</term>
<listitem>
<simpara>TODO</simpara>
<simpara>Gregorian Calendar</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
</section>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<reference xml:id="class.dateformatter" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The DateFormatter class</title>
<titleabbrev>DateFormatter</titleabbrev>
@ -9,9 +9,16 @@
<!-- {{{ DateFormatter intro -->
<section xml:id="dateformatter.intro">
&reftitle.intro;
<para>
TODO
</para>
<simpara>
Date Formatter is a concrete class that enables locale-dependent formatting/parsing
of dates using pattern strings and/or canned patterns.
</simpara>
<simpara>
This class represents the ICU date formatting functionality.
It allows users to display dates in a localized format or to parse strings
into PHP date values using pattern strings and/or canned patterns.
</simpara>
</section>
<!-- }}} -->
@ -34,6 +41,17 @@
</section>
<section xml:id="dateformatter.seealso">
&reftitle.seealso;
<para>
<simplelist>
<member>
<link xlink:href="&url.icu.dateformat;">ICU Date formatter</link>
</member>
</simplelist>
</para>
</section>
&reference.intl.dateformatter-constants;
</partintro>
@ -60,4 +78,4 @@
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.create" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::create</refname>
@ -21,7 +21,7 @@
</methodsynopsis>
<para>Object oriented style (constructor)</para>
<classsynopsis>
<ooclass><classname>DateFormatter</classname></ooclass>
<ooclass><classname>DateFormatter::__construct</classname></ooclass>
<constructorsynopsis>
<methodname>__construct</methodname>
<methodparam><type>string</type><parameter>locale</parameter></methodparam>
@ -44,7 +44,7 @@
</methodsynopsis>
<para>
Create a date formatter
GREGORIAN </para>
</para>
</refsect1>
<refsect1 role="parameters">
@ -55,35 +55,45 @@ GREGORIAN </para>
<term><parameter>locale</parameter></term>
<listitem>
<para>
Locale to use when formatting or parsing </para>
Locale to use when formatting or parsing
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>datetype</parameter></term>
<listitem>
<para>
Date type to use (none, short, medium, long, full) </para>
Date type to use (none, short, medium, long, full).
This is one of the
<link linkend="intl.dateformatter-constants">DateFormatter constants</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>timetype</parameter></term>
<listitem>
<para>
Time type to use (none, short, medium, long, full) </para>
Time type to use (none, short, medium, long, full).
This is one of the
<link linkend="intl.dateformatter-constants">DateFormatter constants</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>timezone</parameter></term>
<listitem>
<para>
Time zone ID ; default is system default </para>
Time zone ID, default is system default. </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>calendar</parameter></term>
<listitem>
<para>
Calendar to use for formatting or parsing; default is </para>
Calendar to use for formatting or parsing; default is Gregorian.
This is one of the
<link linkend="intl.dateformatter-constants.calendartypes">DateFormatter calendar constants</link>.
</para>
</listitem>
</varlistentry>
<varlistentry>
@ -110,8 +120,16 @@ GREGORIAN </para>
<title><function>datefmt_create</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "First Formatted output is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "First Formatted output with pattern is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "Second Formatted output with pattern is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -120,8 +138,16 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "First Formatted output is ".$fmt->format(0);
$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second Formatted output is ".$fmt->format(0);
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "First Formatted output with pattern is ".$fmt->format(0);
$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN , "MM/dd/yyyy");
echo "Second Formatted output with pattern is ".$fmt->format(0);
?>
]]>
</programlisting>
@ -129,15 +155,23 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
]]>
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT
Second Formatted output is Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00
First Formatted output with pattern is 12/31/1969
Second Formatted output with pattern is 12/31/1969
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_format</function></member>
<member><function>datefmt_parse</function></member>
<member><function>datefmt_get_error_code</function></member>
<member><function>datefmt_get_error_message</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::format</refname>
<refname>datefmt_format</refname>
<refpurpose>formats the time value as a string.</refpurpose>
<refpurpose>Format the date/time value as a string</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -13,19 +13,18 @@
<ooclass><classname>DateFormatter</classname></ooclass>
<methodsynopsis>
<type>string</type><methodname>format</methodname>
<methodparam choice='opt'><type>mixed</type><parameter>value</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>Procedural style</para>
<methodsynopsis>
<type>string</type><methodname>datefmt_format</methodname>
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
<methodparam choice='opt'><type>mixed</type><parameter>value</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
formats the time value as a string.
integer: a unix timestamp value (seconds since epoch, UTC)
array: a localtime array </para>
Formats the time value as a string.
</para>
</refsect1>
<refsect1 role="parameters">
@ -43,7 +42,9 @@ array: a localtime array </para>
<term><parameter>value</parameter></term>
<listitem>
<para>
- value to format </para>
Value to format. Can be <type>integer</type> for an Unix timestamp value (seconds since epoch, UTC) or
<type>array</type> for a <function>localtime</function> array.
</para>
</listitem>
</varlistentry>
</variablelist>
@ -54,7 +55,7 @@ array: a localtime array </para>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
a formatted string or, if an error occurred, 'null'. </para>
The formatted string or, if an error occurred, &false;. </para>
</refsect1>
<refsect1 role="examples">
@ -63,8 +64,17 @@ array: a localtime array </para>
<title><function>datefmt_format</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "First Formatted output is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "First Formatted output with pattern is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "Second Formatted output with pattern is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -73,8 +83,16 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "First Formatted output is ".$fmt->format(0);
$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second Formatted output is ".$fmt->format(0);
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "First Formatted output with pattern is ".$fmt->format(0);
$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN , "MM/dd/yyyy");
echo "Second Formatted output with pattern is ".$fmt->format(0);
?>
]]>
</programlisting>
@ -82,7 +100,10 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT
Second Formatted output is Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00
First Formatted output with pattern is 12/31/1969
Second Formatted output with pattern is 12/31/1969
]]>
</screen>
</refsect1>
@ -90,7 +111,12 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_create</function></member>
<member><function>datefmt_parse</function></member>
<member><function>datefmt_get_error_code</function></member>
<member><function>datefmt_get_error_message</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.getcalendar" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getCalendar</refname>
@ -44,7 +44,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
the calendar being used by the formatter </para>
The calendar being used by the formatter. </para>
</refsect1>
<refsect1 role="examples">
@ -53,8 +53,11 @@
<title><function>datefmt_get_calendar</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".datefmt_get_calendar($fmt);
datefmt_set_calendar($fmt,DateFormatter::TRADITIONAL);
echo "Now calendar of the formatter is : ".datefmt_get_calendar($fmt);
?>
]]>
</programlisting>
@ -63,8 +66,12 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".$fmt->getCalendar();
$fmt->setCalendar(DateFormatter::TRADITIONAL);
echo "Now calendar of the formatter is : ".$fmt->getCalendar();
?>
]]>
</programlisting>
@ -72,7 +79,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
calendar of the formatter is : 1
Now calendar of the formatter is : 0
]]>
</screen>
</refsect1>
@ -80,7 +88,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_set_calendar</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.getdatetype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getDateType</refname>
@ -22,6 +22,7 @@
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
</methodsynopsis>
<para>
Returns date type used by the formatter.
</para>
</refsect1>
@ -33,7 +34,7 @@
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource.</para>
</listitem>
</varlistentry>
</variablelist>
@ -44,7 +45,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
the current 'datetype' value of the formatter </para>
The current <link linkend="intl.dateformatter-constants">date type</link> value of the formatter.
</para>
</refsect1>
<refsect1 role="examples">
@ -53,8 +55,14 @@
<title><function>datefmt_get_datetype</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "datetype of the formatter is : ".datefmt_get_datetype($fmt);
echo "First Formatted output with datetype is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "en_US" ,DateFormatter::SHORT,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Now datetype of the formatter is : ".datefmt_get_datetype($fmt);
echo "Second Formatted output with datetype is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -63,8 +71,14 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN);
echo "datetype of the formatter is : ".$fmt->getDateType();
echo "First Formatted output is ".datefmt_format( $fmt , 0);
$fmt = new DateFormatter( "en_US" ,DateFormatter::SHORT,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN);
echo "Now datetype of the formatter is : ".$fmt->getDateType();
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -72,7 +86,10 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
datetype of the formatter is : 0
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT
Now datetype of the formatter is : 2
Second Formatted output is 12/31/69 4:00:00 PM PT
]]>
</screen>
</refsect1>
@ -80,7 +97,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_timetype</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.geterrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getErrorCode</refname>
@ -34,7 +34,7 @@ Returns error code from the last number formatting operation. </para>
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource. </para>
</listitem>
</varlistentry>
</variablelist>
@ -54,8 +54,12 @@ Returns error code from the last number formatting operation. </para>
<title><function>datefmt_get_error_code</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
$str = datefmt_format($fmt);
if(!$str) {
echo "ERROR: ".datefmt_get_error_message($fmt) . " (" . datefmt_get_error_code($fmt) . ")\n";
}
?>
]]>
</programlisting>
@ -64,8 +68,12 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
$str = $fmt->format();
if(!$str) {
echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
}
?>
]]>
</programlisting>
@ -73,7 +81,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
ERROR: U_ZERO_ERROR (0)
]]>
</screen>
</refsect1>
@ -81,7 +89,11 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_error_message</function></member>
<member><function>intl_get_error_code</function></member>
<member><function>intl_is_failure</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.geterrormessage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getErrorMessage</refname>
@ -33,7 +33,7 @@
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource. </para>
</listitem>
</varlistentry>
</variablelist>
@ -53,8 +53,12 @@
<title><function>datefmt_get_error_message</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
$str = datefmt_format($fmt);
if(!$str) {
echo "ERROR: ".datefmt_get_error_message($fmt) . " (" . datefmt_get_error_code($fmt) . ")\n";
}
?>
]]>
</programlisting>
@ -63,8 +67,13 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
$str = $fmt->format();
if(!$str) {
echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
}
?>
]]>
</programlisting>
@ -72,7 +81,7 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
ERROR: U_ZERO_ERROR (0)
]]>
</screen>
</refsect1>
@ -80,7 +89,11 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_error_code</function></member>
<member><function>intl_get_error_code</function></member>
<member><function>intl_is_failure</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.getlocale" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getLocale</refname>
<refname>datefmt_get_locale</refname>
<refpurpose>values may include ULOC_ACTUAL_LOCALE,</refpurpose>
<refpurpose>Get the locale used by formatter</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -13,19 +13,18 @@
<ooclass><classname>DateFormatter</classname></ooclass>
<methodsynopsis>
<type>string</type><methodname>getLocale</methodname>
<methodparam choice='opt'><type>integer</type><parameter>hich</parameter></methodparam>
<methodparam choice='opt'><type>integer</type><parameter>which</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>Procedural style</para>
<methodsynopsis>
<type>string</type><methodname>datefmt_get_locale</methodname>
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
<methodparam choice='opt'><type>integer</type><parameter>hich</parameter></methodparam>
<methodparam choice='opt'><type>integer</type><parameter>which</parameter></methodparam>
</methodsynopsis>
<para>
values may include ULOC_ACTUAL_LOCALE,
ULOC_VALID_LOCALE. By default the actual
locale is returned. </para>
Get locale used by the formatter.
</para>
</refsect1>
<refsect1 role="parameters">
@ -43,7 +42,11 @@ locale is returned. </para>
<term><parameter>hich</parameter></term>
<listitem>
<para>
locale should be returned? </para>
You can choose between valid and actual locale (
<constant>Locale::VALID_LOCALE</constant>,
<constant>Locale::ACTUAL_LOCALE</constant>,
respectively). The default is the actual locale.
</para>
</listitem>
</varlistentry>
</variablelist>
@ -63,8 +66,14 @@ locale is returned. </para>
<title><function>datefmt_get_locale</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "locale of the formatter is : ".datefmt_get_locale($fmt);
echo "First Formatted output is ".datefmt_format( $fmt , 0);
echo "locale of the formatter is : ".datefmt_get_locale($fmt);
$fmt = datefmt_create( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -73,8 +82,14 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "locale of the formatter is : ".$fmt->getLocale();
echo "First Formatted output is ".$fmt->format(0);
$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "locale of the formatter is : ".$fmt->getLocale();
echo "Second Formatted output is ".$fmt->format(0);
?>
]]>
</programlisting>
@ -82,7 +97,10 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
locale of the formatter is : en
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT
locale of the formatter is : de
Second Formatted output is Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00
]]>
</screen>
</refsect1>
@ -90,7 +108,9 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.getpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getPattern</refname>
@ -22,7 +22,8 @@
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
</methodsynopsis>
<para>
</para>
Get pattern used by the formatter.
</para>
</refsect1>
<refsect1 role="parameters">
@ -33,7 +34,7 @@
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource. </para>
</listitem>
</varlistentry>
</variablelist>
@ -44,7 +45,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
the pattern string being used to format/parse </para>
the pattern string being used to format/parse. </para>
</refsect1>
<refsect1 role="examples">
@ -53,8 +54,14 @@
<title><function>datefmt_get_pattern</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "pattern of the formatter is : ".datefmt_get_pattern($fmt);
echo "First Formatted output with pattern is ".datefmt_format( $fmt , 0);
datefmt_set_pattern($fmt,'yyyymmdd hh:mm:ss z');
echo "Now pattern of the formatter is : ".datefmt_get_pattern($fmt);
echo "Second Formatted output with pattern is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -63,8 +70,13 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN,"MM/dd/yyyy" );
echo "pattern of the formatter is : ".$fmt->getPattern();
echo "First Formatted output is ".datefmt_format( $fmt , 0);
$fmt->setPattern('yyyymmdd hh:mm:ss z');
echo "Now pattern of the formatter is : ".$fmt->getPattern();
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -72,7 +84,10 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
pattern of the formatter is : MM/dd/yyyy
First Formatted output is 12/31/1969
Now pattern of the formatter is : yyyymmdd hh:mm:ss z
Second Formatted output is 19690031 04:00:00 PST
]]>
</screen>
</refsect1>
@ -80,7 +95,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_set_pattern</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.gettimetype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getTimeType</refname>
@ -22,6 +22,7 @@
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
</methodsynopsis>
<para>
Return time type used by the formatter.
</para>
</refsect1>
@ -33,7 +34,7 @@
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource. </para>
</listitem>
</varlistentry>
</variablelist>
@ -44,7 +45,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
the current 'timetype' value of the formatter </para>
The current <link linkend="intl.dateformatter-constants">date type</link> value of the formatter.
</para>
</refsect1>
<refsect1 role="examples">
@ -53,8 +55,14 @@
<title><function>datefmt_get_timetype</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "timetype of the formatter is : ".datefmt_get_timetype($fmt);
echo "First Formatted output with timetype is ".datefmt_format( $fmt , 0);
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::SHORT,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Now timetype of the formatter is : ".datefmt_get_timetype($fmt);
echo "Second Formatted output with timetype is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -63,8 +71,14 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN);
echo "timetype of the formatter is : ".$fmt->getTimeType();
echo "First Formatted output is ".datefmt_format( $fmt , 0);
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::SHORT,'America/Los_Angeles',DateFormatter::GREGORIAN);
echo "Now timetype of the formatter is : ".$fmt->getTimeType();
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -72,7 +86,10 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
timetype of the formatter is : 0
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT
Now timetype of the formatter is : 3
Second Formatted output is Wednesday, December 31, 1969 4:00 PM
]]>
</screen>
</refsect1>
@ -80,7 +97,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_datetype</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.gettimezoneid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::getTimeZoneId</refname>
@ -33,7 +33,7 @@
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource. </para>
</listitem>
</varlistentry>
</variablelist>
@ -44,7 +44,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
ID string for the time zone used by this formatter </para>
ID string for the time zone used by this formatter. </para>
</refsect1>
<refsect1 role="examples">
@ -53,8 +53,12 @@
<title><function>datefmt_get_timezone_id</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "timezone_id of the formatter is : ".datefmt_get_timezone_id($fmt);
datefmt_set_timezone_id($fmt,'CN');
echo "Now timezone_id of the formatter is : ".datefmt_get_timezone_id($fmt);
?>
]]>
</programlisting>
@ -63,8 +67,12 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "timezone_id of the formatter is : ".$fmt->getTimezoneId();
$fmt->setTimezoneId('CN');
echo "Now timezone_id of the formatter is : ".$fmt->getTimezoneId();
?>
]]>
</programlisting>
@ -72,7 +80,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
timezone_id of the formatter is : America/Los_Angeles
Now timezone_id of the formatter is : CN
]]>
</screen>
</refsect1>
@ -80,7 +89,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_set_timezone_id</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.islenient" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::isLenient</refname>
@ -22,7 +22,8 @@
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
</methodsynopsis>
<para>
</para>
Check if the parser is strict or lenient in interpretting inputs that do not match the pattern exactly.
</para>
</refsect1>
<refsect1 role="parameters">
@ -44,7 +45,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
'true' if parser is lenient, 'false' if parser is strictdefault value for parser is 'false'. </para>
&true; if parser is lenient, &false; if parser is strict. By default the parser is strict.
</para>
</refsect1>
<refsect1 role="examples">
@ -53,8 +55,22 @@
<title><function>datefmt_is_lenient</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
datefmt_set_lenient($fmt,false);
echo "Now lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
?>
]]>
</programlisting>
@ -63,8 +79,22 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN,"MM/dd/yyyy" );
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
$fmt->setLenient(FALSE);
echo "Now lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
?>
]]>
</programlisting>
@ -72,7 +102,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
lenient of the formatter is : TRUE
Now lenient of the formatter is : FALSE
]]>
</screen>
</refsect1>
@ -80,7 +111,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_set_lenient</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.localtime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::localtime</refname>
<refname>datefmt_localtime</refname>
<refpurpose>converts string $value to a field-based time value, starting at</refpurpose>
<refpurpose>Parse string to a field-based time value</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -96,8 +96,17 @@ If $parse_pos > strlen($value), the parse fails immediately. </para>
<title><function>datefmt_localtime</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
$arr = datefmt_localtime( $fmt, "Wednesday, December 31, 1969 4:00:00 PM PT",0,0);
echo "First parsed output is ";
if ($arr) {
foreach ($arr as $key => $value) {
echo "$key : $value , ";
}
}
?>
]]>
</programlisting>
@ -106,8 +115,16 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
$arr = $fmt->localtime( "Wednesday, December 31, 1969 4:00:00 PM PT",0,0);
echo "First parsed output is ";
if ($arr) {
foreach ($arr as $key => $value) {
echo "$key : $value , ";
}
}
?>
]]>
</programlisting>
@ -115,7 +132,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 4 , tm_year : 1969 ,
tm_mday : 31 , tm_wday : 4 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0 ,
]]>
</screen>
</refsect1>
@ -123,7 +141,13 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_create</function></member>
<member><function>datefmt_format</function></member>
<member><function>datefmt_parse</function></member>
<member><function>datefmt_get_error_code</function></member>
<member><function>datefmt_get_error_message</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,115 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="dateformatter.parsetolocaltime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::parseToLocaltime</refname>
<refname>datefmt_parse_to_localtime</refname>
<refpurpose>Field-based equivalent of parse().</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>Object oriented style</para>
<classsynopsis>
<ooclass><classname>DateFormatter</classname></ooclass>
<methodsynopsis>
<type>array</type><methodname>parseToLocaltime</methodname>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>Procedural style</para>
<methodsynopsis>
<type>array</type><methodname>datefmt_parse_to_localtime</methodname>
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
Field-based equivalent of parse(). </para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
String value to parse into a date. </para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
An array in the same format as localtime produces </para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>datefmt_parse_to_localtime</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
?>
]]>
</programlisting>
</example>
<example>
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
TODO
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,116 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<refentry xml:id="dateformatter.parsetotimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::parseToTimestamp</refname>
<refname>datefmt_parse_to_timestamp</refname>
<refpurpose>converts the string $value to a Unix timestamp (a time_t integer</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<para>Object oriented style</para>
<classsynopsis>
<ooclass><classname>DateFormatter</classname></ooclass>
<methodsynopsis>
<type>integer</type><methodname>parseToTimestamp</methodname>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
</classsynopsis>
<para>Procedural style</para>
<methodsynopsis>
<type>integer</type><methodname>datefmt_parse_to_timestamp</methodname>
<methodparam><type>DateFormatter</type><parameter>fmt</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>
converts the string $value to a Unix timestamp (a time_t integer
value, seconds since epoch). </para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
string to convert to a time </para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
timestamp value </para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>datefmt_parse_to_timestamp</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
?>
]]>
</programlisting>
</example>
<example>
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
?>
]]>
</programlisting>
</example>
&example.outputs;
<screen>
<![CDATA[
TODO
]]>
</screen>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.parse" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::parse</refname>
<refname>datefmt_parse</refname>
<refpurpose>converts string $value to an incremental time value, starting at</refpurpose>
<refpurpose>Parse string to a timestamp value</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -86,8 +86,11 @@ If $parse_pos > strlen($value), the parse fails immediately. </para>
<title><function>datefmt_parse</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "First parsed output is ".$fmt->parse("Wednesday, December 31, 1969 4:00:00 PM PT");
$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second parsed output is ".$fmt->parse("Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00");
?>
]]>
</programlisting>
@ -96,8 +99,11 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "First parsed output is ".datefmt_parse( $fmt , "Wednesday, December 31, 1969 4:00:00 PM PT");
$fmt = datefmt_create( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "Second parsed output is ".datefmt_parse( $fmt , "Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00");
?>
]]>
</programlisting>
@ -105,7 +111,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
First parsed output is 0
Second parsed output is 0
]]>
</screen>
</refsect1>
@ -113,7 +120,13 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_create</function></member>
<member><function>datefmt_format</function></member>
<member><function>datefmt_localtime</function></member>
<member><function>datefmt_get_error_code</function></member>
<member><function>datefmt_get_error_message</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.setcalendar" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::setCalendar</refname>
@ -23,11 +23,8 @@
<methodparam><type>integer</type><parameter>which</parameter></methodparam>
</methodsynopsis>
<para>
sets the calendar used to the appropriate calendar, which must be
one of the constants defined above. Some examples include:
- Gregorian calendar
- Traditional
Default value is GREGORIAN </para>
Sets the calendar used by the formatter.
</para>
</refsect1>
<refsect1 role="parameters">
@ -38,14 +35,17 @@ Default value is GREGORIAN </para>
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>which</parameter></term>
<listitem>
<para>
the calendar (an enumerated constant) to use. </para>
The <link linkend="intl.dateformatter-constants.calendartypes">calendar</link> to use.
Default is <constant>DateFormatter::GREGORIAN</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
@ -56,7 +56,8 @@ Default value is GREGORIAN </para>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
'true' if successful, 'false' if an error occurred or if the calendar was not recognized </para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
@ -65,8 +66,11 @@ Default value is GREGORIAN </para>
<title><function>datefmt_set_calendar</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".datefmt_get_calendar($fmt);
datefmt_set_calendar($fmt,DateFormatter::TRADITIONAL);
echo "Now calendar of the formatter is : ".datefmt_get_calendar($fmt);
?>
]]>
</programlisting>
@ -75,8 +79,11 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".$fmt->getCalendar();
$fmt->setCalendar(DateFormatter::TRADITIONAL);
echo "Now calendar of the formatter is : ".$fmt->getCalendar();
?>
]]>
</programlisting>
@ -84,7 +91,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
calendar of the formatter is : 1
Now calendar of the formatter is : 0
]]>
</screen>
</refsect1>
@ -92,7 +100,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_calendar</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.setlenient" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::setLenient</refname>
<refname>datefmt_set_lenient</refname>
<refpurpose>'true' sets the parser to accept otherwise flawed date or</refpurpose>
<refpurpose>Set the leniency of the parser</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -23,11 +23,11 @@
<methodparam><type>boolean</type><parameter>lenient</parameter></methodparam>
</methodsynopsis>
<para>
'true' sets the parser to accept otherwise flawed date or
time patterns, parsing as much as possible to obtain a value.
'false' sets the parser to strictly parse strings into dates.
Extra space, unrecognized tokens, or invalid values
("Feburary 30th") are not accepted. </para>
Define if the parser is strict or lenient in interpretting inputs that do not match the pattern exactly.
Enabling lenient parsing allows the parser to accept otherwise flawed date or
time patterns, parsing as much as possible to obtain a value.
Extra space, unrecognized tokens, or invalid values ("Feburary 30th") are not accepted.
</para>
</refsect1>
<refsect1 role="parameters">
@ -45,7 +45,8 @@ Extra space, unrecognized tokens, or invalid values
<term><parameter>lenient</parameter></term>
<listitem>
<para>
sets whether the parser is lenient or not, default is 'false' </para>
Sets whether the parser is lenient or not, default is &false; (strict).
</para>
</listitem>
</varlistentry>
</variablelist>
@ -56,7 +57,8 @@ Extra space, unrecognized tokens, or invalid values
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
'true' if successful; 'false' if an error occurred. </para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
@ -65,8 +67,22 @@ Extra space, unrecognized tokens, or invalid values
<title><function>datefmt_set_lenient</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
datefmt_set_lenient($fmt,false);
echo "Now lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
?>
]]>
</programlisting>
@ -75,8 +91,21 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN,"MM/dd/yyyy" );
echo "lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
$fmt->setLenient(FALSE);
echo "Now lenient of the formatter is : ";
if( $fmt->isLenient() ){
echo('TRUE');
}else{
echo('FALSE');
}
?>
]]>
</programlisting>
@ -84,7 +113,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
lenient of the formatter is : TRUE
Now lenient of the formatter is : FALSE
]]>
</screen>
</refsect1>
@ -92,7 +122,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_is_lenient</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.setpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::setPattern</refname>
@ -52,7 +52,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
'true' if successful, 'false' if an error occured. Bad formatstrings are usually the cause of the latter. </para>
&return.success;
Bad formatstrings are usually the cause of the failure.
</para>
</refsect1>
<refsect1 role="examples">
@ -61,8 +63,14 @@
<title><function>datefmt_set_pattern</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy");
echo "pattern of the formatter is : ".datefmt_get_pattern($fmt);
echo "First Formatted output with pattern is ".datefmt_format( $fmt , 0);
datefmt_set_pattern($fmt,'yyyymmdd hh:mm:ss z');
echo "Now pattern of the formatter is : ".datefmt_get_pattern($fmt);
echo "Second Formatted output with pattern is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -71,8 +79,14 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN,"MM/dd/yyyy" );
echo "pattern of the formatter is : ".$fmt->getPattern();
echo "First Formatted output is ".datefmt_format( $fmt , 0);
$fmt->setPattern('yyyymmdd hh:mm:ss z');
echo "Now pattern of the formatter is : ".$fmt->getPattern();
echo "Second Formatted output is ".datefmt_format( $fmt , 0);
?>
]]>
</programlisting>
@ -80,7 +94,10 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
pattern of the formatter is : MM/dd/yyyy
First Formatted output with pattern is 12/31/1969
Now pattern of the formatter is : yyyymmdd hh:mm:ss z
Second Formatted output with pattern is 19690031 04:00:00 PST
]]>
</screen>
</refsect1>
@ -88,7 +105,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_pattern</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="dateformatter.settimezoneid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DateFormatter::setTimeZoneId</refname>
<refname>datefmt_set_timezone_id</refname>
<refpurpose>sets the time zone to use</refpurpose>
<refpurpose>Sets the time zone to use</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
@ -23,9 +23,8 @@
<methodparam><type>string</type><parameter>zone</parameter></methodparam>
</methodsynopsis>
<para>
sets the time zone to use
if null or the empty string, the default time zone for
the runtime is used. </para>
Sets the time zone to use.
</para>
</refsect1>
<refsect1 role="parameters">
@ -36,14 +35,16 @@ the runtime is used. </para>
<term><parameter>fmt</parameter></term>
<listitem>
<para>
The formatter resource </para>
The formatter resource. </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>zone</parameter></term>
<listitem>
<para>
zone ID string of the time zone to use. </para>
The time zone ID string of the time zone to use.
If &null; or the empty string, the default time zone for the runtime is used.
</para>
</listitem>
</varlistentry>
</variablelist>
@ -54,7 +55,8 @@ the runtime is used. </para>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
'true' on successful setting of the time zone, 'false'if an error occurred (such as the time zone wasn't recognized). </para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
@ -63,8 +65,11 @@ the runtime is used. </para>
<title><function>datefmt_set_timezone_id</function> example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = datefmt_create( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "timezone_id of the formatter is : ".datefmt_get_timezone_id($fmt);
datefmt_set_timezone_id($fmt,'CN');
echo "Now timezone_id of the formatter is : ".datefmt_get_timezone_id($fmt);
?>
]]>
</programlisting>
@ -73,8 +78,12 @@ TODO
<title>OO example</title>
<programlisting role="php">
<![CDATA[
< ?php
TODO
<?php
$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN );
echo "timezone_id of the formatter is : ".$fmt->getTimezoneId();
$fmt->setTimezoneId('CN');
echo "Now timezone_id of the formatter is : ".$fmt->getTimezoneId();
?>
]]>
</programlisting>
@ -82,7 +91,8 @@ TODO
&example.outputs;
<screen>
<![CDATA[
TODO
timezone_id of the formatter is : America/Los_Angeles
Now timezone_id of the formatter is : CN
]]>
</screen>
</refsect1>
@ -90,7 +100,10 @@ TODO
<refsect1 role="seealso">
&reftitle.seealso;
<para>
TODO
<simplelist>
<member><function>datefmt_get_timezone_id</function></member>
<member><function>datefmt_create</function></member>
</simplelist>
</para>
</refsect1>
</refentry>