mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Document IntlDateFormatter::getTimeZone
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330514 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
ff86dfcfa7
commit
8b5c6b1498
1 changed files with 68 additions and 2 deletions
|
@ -5,7 +5,7 @@
|
|||
<refnamediv>
|
||||
<refname>IntlDateFormatter::getTimeZone</refname>
|
||||
<refname>datefmt_get_timezone</refname>
|
||||
<refpurpose>Get formatter timezone</refpurpose>
|
||||
<refpurpose>Get formatterʼs timezone</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
|
@ -26,7 +26,15 @@
|
|||
<void />
|
||||
</methodsynopsis>
|
||||
|
||||
&warn.undocumented.func;
|
||||
<para>
|
||||
Returns an <classname>IntlTimeZone</classname> object representing the
|
||||
timezone that will be used by this object to format dates and times. When
|
||||
formatting <classname>IntlCalendar</classname> and
|
||||
<classname>DateTime</classname> objects with this
|
||||
<classname>IntlDateFormatter</classname>, the timezone used will be the one
|
||||
returned by this method, not the one associated with the objects being
|
||||
formatted.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
|
@ -37,8 +45,66 @@
|
|||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The associated <classname>IntlTimeZone</classname>
|
||||
object&return.falseforfailure;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>IntlDateFormatter::getTimeZone</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$madrid = IntlDateFormatter::create(NULL, NULL, NULL, 'Europe/Madrid');
|
||||
$lisbon = IntlDateFormatter::create(NULL, NULL, NULL, 'Europe/Lisbon');
|
||||
|
||||
var_dump($madrid->getTimezone());
|
||||
echo $madrid->getTimezone()->getDisplayName(
|
||||
false, IntlTimeZone::DISPLAY_GENERIC_LOCATION, "en_US"), "\n";
|
||||
echo $lisbon->getTimeZone()->getId(), "\n";
|
||||
//The id can also be retrieved with ->getTimezoneId()
|
||||
echo $lisbon->getTimeZoneId(), "\n";
|
||||
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(IntlTimeZone)#4 (4) {
|
||||
["valid"]=>
|
||||
bool(true)
|
||||
["id"]=>
|
||||
string(13) "Europe/Madrid"
|
||||
["rawOffset"]=>
|
||||
int(3600000)
|
||||
["currentOffset"]=>
|
||||
int(7200000)
|
||||
}
|
||||
Spain Time
|
||||
Europe/Lisbon
|
||||
Europe/Lisbon
|
||||
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>IntlDateFormatter::getTimeZoneId</function></member>
|
||||
<member><function>IntlDateFormatter::setTimeZone</function></member>
|
||||
<member><classname>IntlTimeZone</classname></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
|
|
Loading…
Reference in a new issue