<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.intlcalendar.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'intlcalendar.settimezone.php',
    1 => 'IntlCalendar::setTimeZone',
    2 => 'Set the timezone used by this calendar',
  ),
  'up' => 
  array (
    0 => 'class.intlcalendar.php',
    1 => 'IntlCalendar',
  ),
  'prev' => 
  array (
    0 => 'intlcalendar.settime.php',
    1 => 'IntlCalendar::setTime',
  ),
  'next' => 
  array (
    0 => 'intlcalendar.todatetime.php',
    1 => 'IntlCalendar::toDateTime',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/intl/intlcalendar/settimezone.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intlcalendar.settimezone" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::setTimeZone</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::setTimeZone</span> &mdash; <span class="dc-title">Set the timezone used by this calendar</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.settimezone-description">
  <h3 class="title">Descrizione</h3>
  <p class="para">
   Stile orientato agli oggetti
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>IntlCalendar::setTimeZone</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.intltimezone.php" class="type IntlTimeZone">IntlTimeZone</a></span>|<span class="type"><a href="class.datetimezone.php" class="type DateTimeZone">DateTimeZone</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$timezone</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Stile procedurale
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>intlcal_set_time_zone</strong></span>(<span class="methodparam"><span class="type"><a href="class.intlcalendar.php" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$calendar</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="class.intltimezone.php" class="type IntlTimeZone">IntlTimeZone</a></span>|<span class="type"><a href="class.datetimezone.php" class="type DateTimeZone">DateTimeZone</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$timezone</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Defines a new timezone for this calendar. The time represented by the
   object is preserved to the detriment of the field values.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.settimezone-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <dl>
   
    <dt><code class="parameter">calendar</code></dt>
    <dd>
     <p class="para">An <span class="classname"><a href="class.intlcalendar.php" class="classname">IntlCalendar</a></span> instance.</p>
    </dd>
   
   
    <dt><code class="parameter">timezone</code></dt>
    <dd>
     <p class="para">
      The new timezone to be used by this calendar. It can be specified in the
      following ways:
      

<ul class="itemizedlist">
 <li class="listitem">
  <p class="para">
   <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, in which case the default timezone will be used, as specified in
   the ini setting <a href="datetime.configuration.php#ini.date.timezone" class="link">date.timezone</a> or
   through the function <span class="function"><a href="function.date-default-timezone-set.php" class="function">date_default_timezone_set()</a></span> and as
   returned by <span class="function"><a href="function.date-default-timezone-get.php" class="function">date_default_timezone_get()</a></span>.
  </p>
 </li>
 <li class="listitem">
  <p class="para">
   An <span class="classname"><a href="class.intltimezone.php" class="classname">IntlTimeZone</a></span>, which will be used directly.
  </p>
 </li>
 <li class="listitem">
  <p class="para">
   A <span class="classname"><a href="class.datetimezone.php" class="classname">DateTimeZone</a></span>. Its identifier will be extracted
   and an ICU timezone object will be created; the timezone will be backed
   by ICUʼs database, not PHPʼs.
  </p>
 </li>
 <li class="listitem">
  <p class="para">
   A <span class="type"><a href="language.types.string.php" class="type string">string</a></span>, which should be a valid ICU timezone identifier.
   See <span class="function"><a href="intltimezone.createtimezoneidenumeration.php" class="function">IntlTimeZone::createTimeZoneIDEnumeration()</a></span>. Raw
   offsets such as <code class="literal">&quot;GMT+08:30&quot;</code> are also accepted.
  </p>
 </li>
</ul>

     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.settimezone-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>



 <div class="refsect1 examples" id="refsect1-intlcalendar.settimezone-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>IntlCalendar::setTimeZone()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'date.timezone'</span><span style="color: #007700">, </span><span style="color: #DD0000">'Europe/Lisbon'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'intl.default_locale'</span><span style="color: #007700">, </span><span style="color: #DD0000">'es_ES'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cal </span><span style="color: #007700">= new </span><span style="color: #0000BB">IntlGregorianCalendar</span><span style="color: #007700">(</span><span style="color: #0000BB">2013</span><span style="color: #007700">, </span><span style="color: #0000BB">5 </span><span style="color: #FF8000">/* May */</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">12</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">FULL</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"(instant </span><span style="color: #007700">{</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">()}</span><span style="color: #DD0000">)\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setTimeZone</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlTimeZone</span><span style="color: #007700">::</span><span style="color: #0000BB">getGMT</span><span style="color: #007700">());<br />echo </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">FULL</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"(instant </span><span style="color: #007700">{</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">()}</span><span style="color: #DD0000">)\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setTimeZone</span><span style="color: #007700">(</span><span style="color: #DD0000">'GMT+03:33'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">FULL</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"(instant </span><span style="color: #007700">{</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTime</span><span style="color: #007700">()}</span><span style="color: #DD0000">)\n"</span><span style="color: #007700">;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">sábado, 1 de junio de 2013 12:00:00 Hora de verano de Europa occidental
(instant 1370084400000)
sábado, 1 de junio de 2013 11:00:00 GMT
(instant 1370084400000)
sábado, 1 de junio de 2013 14:33:00 GMT+03:33
(instant 1370084400000)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


</div><?php manual_footer($setup); ?>