2012-11-23 09:10:30 +00:00
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
<!-- $Revision$ -->
|
|
|
|
|
|
|
|
|
|
<refentry xml:id="intldateformatter.settimezone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
|
|
|
<refnamediv>
|
|
|
|
|
<refname>IntlDateFormatter::setTimeZone</refname>
|
|
|
|
|
<refname>datefmt_set_timezone</refname>
|
2013-06-16 00:22:23 +00:00
|
|
|
|
<refpurpose>Sets formatterʼs timezone</refpurpose>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
|
&reftitle.description;
|
|
|
|
|
<para>
|
|
|
|
|
&style.oop;
|
|
|
|
|
</para>
|
|
|
|
|
<methodsynopsis>
|
|
|
|
|
<modifier>public</modifier>
|
2018-01-25 15:50:10 +00:00
|
|
|
|
<type>bool</type>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
<methodname>IntlDateFormatter::setTimeZone</methodname>
|
|
|
|
|
<methodparam><type>mixed</type><parameter>zone</parameter></methodparam>
|
|
|
|
|
</methodsynopsis>
|
|
|
|
|
<para>
|
|
|
|
|
&style.procedural;
|
|
|
|
|
</para>
|
|
|
|
|
<methodsynopsis>
|
2018-01-25 15:50:10 +00:00
|
|
|
|
<type>bool</type>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
<methodname>datefmt_set_timezone</methodname>
|
2018-07-25 15:44:51 +00:00
|
|
|
|
<methodparam><type>IntlDateFormatter</type><parameter>fmt</parameter></methodparam>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
<methodparam><type>mixed</type><parameter>zone</parameter></methodparam>
|
|
|
|
|
</methodsynopsis>
|
|
|
|
|
|
2013-06-16 00:22:23 +00:00
|
|
|
|
<para>
|
2018-07-25 15:44:51 +00:00
|
|
|
|
Sets the timezone used for the IntlDateFormatter.
|
2013-06-16 00:22:23 +00:00
|
|
|
|
object.
|
|
|
|
|
</para>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
|
&reftitle.parameters;
|
|
|
|
|
<variablelist>
|
2018-07-25 15:44:51 +00:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><parameter>fmt</parameter></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
|
|
|
|
The formatter resource.
|
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
<varlistentry>
|
|
|
|
|
<term><parameter>zone</parameter></term>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2013-06-16 00:22:23 +00:00
|
|
|
|
The timezone to use for this formatter. This can be specified in the
|
|
|
|
|
following forms:
|
2012-11-23 09:10:30 +00:00
|
|
|
|
</para>
|
2013-06-21 00:47:12 +00:00
|
|
|
|
&reference.intl.inctimezoneparam;
|
2012-11-23 09:10:30 +00:00
|
|
|
|
</listitem>
|
|
|
|
|
</varlistentry>
|
|
|
|
|
</variablelist>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
|
<para>
|
2013-06-16 00:22:23 +00:00
|
|
|
|
Returns &true; on success and &false; on failure.
|
|
|
|
|
</para>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
|
&reftitle.examples;
|
|
|
|
|
<para>
|
|
|
|
|
<example>
|
|
|
|
|
<title><function>IntlDateFormatter::setTimeZone</function> examples</title>
|
|
|
|
|
<programlisting role="php">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
<?php
|
|
|
|
|
ini_set('date.timezone', 'Europe/Amsterdam');
|
|
|
|
|
|
|
|
|
|
$formatter = IntlDateFormatter::create(NULL, NULL, NULL, "UTC");
|
|
|
|
|
|
|
|
|
|
$formatter->setTimeZone(NULL);
|
2013-09-09 16:17:46 +00:00
|
|
|
|
echo "NULL\n ", $formatter->getTimeZone()->getId(), "\n";
|
2012-11-23 09:10:30 +00:00
|
|
|
|
|
2013-06-16 00:22:23 +00:00
|
|
|
|
$formatter->setTimeZone(IntlTimeZone::createTimeZone('Europe/Lisbon'));
|
2013-09-09 16:17:46 +00:00
|
|
|
|
echo "IntlTimeZone\n ", $formatter->getTimeZone()->getId(), "\n";
|
2013-06-16 00:22:23 +00:00
|
|
|
|
|
|
|
|
|
$formatter->setTimeZone(new DateTimeZone('Europe/Paris'));
|
2013-09-09 16:17:46 +00:00
|
|
|
|
echo "DateTimeZone\n ", $formatter->getTimeZone()->getId(), "\n";
|
2013-06-16 00:22:23 +00:00
|
|
|
|
|
|
|
|
|
$formatter->setTimeZone('Europe/Rome');
|
2013-09-09 16:17:46 +00:00
|
|
|
|
echo "String\n ", $formatter->getTimeZone()->getId(), "\n";
|
2013-06-16 00:22:23 +00:00
|
|
|
|
|
|
|
|
|
$formatter->setTimeZone('GMT+00:30');
|
|
|
|
|
print_r($formatter->getTimeZone());
|
|
|
|
|
|
|
|
|
|
]]>
|
|
|
|
|
</programlisting>
|
|
|
|
|
&example.outputs;
|
|
|
|
|
<screen>
|
|
|
|
|
<![CDATA[
|
|
|
|
|
NULL
|
2013-09-09 16:17:46 +00:00
|
|
|
|
Europe/Amsterdam
|
2013-06-16 00:22:23 +00:00
|
|
|
|
IntlTimeZone
|
2013-09-09 16:17:46 +00:00
|
|
|
|
Europe/Lisbon
|
2013-06-16 00:22:23 +00:00
|
|
|
|
DateTimeZone
|
2013-09-09 16:17:46 +00:00
|
|
|
|
Europe/Paris
|
2013-06-16 00:22:23 +00:00
|
|
|
|
String
|
2013-09-09 16:17:46 +00:00
|
|
|
|
Europe/Rome
|
2013-06-16 00:22:23 +00:00
|
|
|
|
IntlTimeZone Object
|
|
|
|
|
(
|
|
|
|
|
[valid] => 1
|
|
|
|
|
[id] => GMT+00:30
|
|
|
|
|
[rawOffset] => 1800000
|
|
|
|
|
[currentOffset] => 1800000
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
]]>
|
|
|
|
|
</screen>
|
|
|
|
|
</example>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
</para>
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
2013-06-16 00:22:23 +00:00
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
|
&reftitle.seealso;
|
|
|
|
|
<para>
|
|
|
|
|
<simplelist>
|
|
|
|
|
<member><function>IntlDateFormatter::getTimeZone</function></member>
|
|
|
|
|
</simplelist>
|
|
|
|
|
</para>
|
|
|
|
|
</refsect1>
|
2012-11-23 09:10:30 +00:00
|
|
|
|
|
|
|
|
|
</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:"~/.phpdoc/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
|
|
|
|
|
-->
|