2008-03-06 01:30:03 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2008-05-05 23:55:00 +00:00
|
|
|
<!-- $Revision: 1.5 $ -->
|
|
|
|
<refentry xml:id="intldateformatter.getpattern" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2008-03-06 01:30:03 +00:00
|
|
|
<refnamediv>
|
2008-05-05 23:55:00 +00:00
|
|
|
<refname>IntlDateFormatter::getPattern</refname>
|
2008-03-06 01:30:03 +00:00
|
|
|
<refname>datefmt_get_pattern</refname>
|
2008-05-05 23:55:00 +00:00
|
|
|
<refpurpose>Get the pattern used for the IntlDateFormatter</refpurpose>
|
2008-03-06 01:30:03 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2008-03-12 23:07:16 +00:00
|
|
|
<para>
|
|
|
|
Object oriented style
|
|
|
|
</para>
|
2008-03-06 01:30:03 +00:00
|
|
|
<methodsynopsis>
|
2008-05-05 23:55:00 +00:00
|
|
|
<type>string</type><methodname>IntlDateFormatter::getPattern</methodname>
|
2008-03-06 01:30:03 +00:00
|
|
|
<void />
|
|
|
|
</methodsynopsis>
|
2008-03-12 23:07:16 +00:00
|
|
|
<para>
|
|
|
|
Procedural style
|
|
|
|
</para>
|
2008-03-06 01:30:03 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>datefmt_get_pattern</methodname>
|
2008-05-05 23:55:00 +00:00
|
|
|
<methodparam><type>IntlDateFormatter</type><parameter>fmt</parameter></methodparam>
|
2008-03-06 01:30:03 +00:00
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2008-03-12 23:07:16 +00:00
|
|
|
Get pattern used by the formatter.
|
2008-03-07 22:46:02 +00:00
|
|
|
</para>
|
2008-03-06 01:30:03 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>fmt</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2008-03-12 23:07:16 +00:00
|
|
|
The formatter resource.
|
|
|
|
</para>
|
2008-03-06 01:30:03 +00:00
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
2008-03-12 23:07:16 +00:00
|
|
|
The pattern string being used to format/parse.
|
|
|
|
</para>
|
2008-03-06 01:30:03 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<example>
|
|
|
|
<title><function>datefmt_get_pattern</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
2008-03-07 22:46:02 +00:00
|
|
|
<?php
|
2008-05-05 23:55:00 +00:00
|
|
|
$fmt = datefmt_create( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN ,"MM/dd/yyyy");
|
2008-03-07 22:46:02 +00:00
|
|
|
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);
|
|
|
|
|
2008-03-06 01:30:03 +00:00
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
<example>
|
|
|
|
<title>OO example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
2008-03-07 22:46:02 +00:00
|
|
|
<?php
|
2008-05-05 23:55:00 +00:00
|
|
|
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN,"MM/dd/yyyy" );
|
2008-03-07 22:46:02 +00:00
|
|
|
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);
|
2008-03-06 01:30:03 +00:00
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
2008-03-07 22:46:02 +00:00
|
|
|
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
|
2008-03-06 01:30:03 +00:00
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
2008-03-07 22:46:02 +00:00
|
|
|
<simplelist>
|
|
|
|
<member><function>datefmt_set_pattern</function></member>
|
|
|
|
<member><function>datefmt_create</function></member>
|
|
|
|
</simplelist>
|
2008-03-06 01:30:03 +00:00
|
|
|
</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
|
|
|
|
-->
|