<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Get behavior for handling repeating wall time</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getnow.html">IntlCalendar::getNow</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getskippedwalltimeoption.html">IntlCalendar::getSkippedWallTimeOption</a></div> <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="intlcalendar.getrepeatedwalltimeoption" class="refentry"> <div class="refnamediv"> <h1 class="refname">IntlCalendar::getRepeatedWallTimeOption</h1> <p class="verinfo">(PHP 5.5.0, PECL >= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getRepeatedWallTimeOption</span> — <span class="dc-title">Get behavior for handling repeating wall time</span></p> </div> <div class="refsect1 description" id="refsect1-intlcalendar.getrepeatedwalltimeoption-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><strong>IntlCalendar::getRepeatedWallTimeOption</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> Gets the current strategy for dealing with wall times that are repeated whenever the clock is set back during dailight saving time end transitions. The default value is <strong><code>IntlCalendar::WALLTIME_LAST</code></strong>. </p> </div> <div class="refsect1 parameters" id="refsect1-intlcalendar.getrepeatedwalltimeoption-parameters"> <h3 class="title">Parameters</h3> <p class="para">This function has no parameters.</p> </div> <div class="refsect1 returnvalues" id="refsect1-intlcalendar.getrepeatedwalltimeoption-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> One of the constants <strong><code>IntlCalendar::WALLTIME_FIRST</code></strong> or <strong><code>IntlCalendar::WALLTIME_LAST</code></strong>. </p> </div> <div class="refsect1 examples" id="refsect1-intlcalendar.getrepeatedwalltimeoption-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2610"> <p><strong>Example #1 <span class="function"><strong>IntlCalendar::getRepeatedWallTimeOption()</strong></span></strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?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">'en_US'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'intl.error_level'</span><span style="color: #007700">, </span><span style="color: #0000BB">E_WARNING</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//On October 27th at 0200, the clock goes back 1 hour and from GMT+01 to GMT+00<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">9 </span><span style="color: #FF8000">/* October */</span><span style="color: #007700">, </span><span style="color: #0000BB">27</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">getRepeatedWalltimeOption</span><span style="color: #007700">()); </span><span style="color: #FF8000">// 0 WALLTIME_LAST<br /><br /></span><span style="color: #0000BB">$formatter </span><span style="color: #007700">= </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">create</span><span style="color: #007700">(<br /> </span><span style="color: #0000BB">NULL</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">FULL</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">FULL</span><span style="color: #007700">,<br /> </span><span style="color: #DD0000">'UTC'<br /></span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$formatter</span><span style="color: #007700">-></span><span style="color: #0000BB">format</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">getTime</span><span style="color: #007700">() / </span><span style="color: #0000BB">1000.</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">setRepeatedWalltimeOption</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">WALLTIME_FIRST</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">getRepeatedWalltimeOption</span><span style="color: #007700">()); </span><span style="color: #FF8000">// 1 WALLTIME_FIRST<br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">FIELD_HOUR_OF_DAY</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$formatter</span><span style="color: #007700">-></span><span style="color: #0000BB">format</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">getTime</span><span style="color: #007700">() / </span><span style="color: #0000BB">1000.</span><span style="color: #007700">));</span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> int(0) string(42) "Sunday, October 27, 2013 at 1:30:00 AM GMT" int(1) string(43) "Sunday, October 27, 2013 at 12:30:00 AM GMT" </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-intlcalendar.getrepeatedwalltimeoption-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="intlcalendar.getskippedwalltimeoption.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::getSkippedWallTimeOption()</a> - Get behavior for handling skipped wall time</span></li> <li class="member"> <span class="methodname"><a href="intlcalendar.setskippedwalltimeoption.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::setSkippedWallTimeOption()</a> - Set behavior for handling skipped wall times at positive timezone offset transitions</span></li> <li class="member"> <span class="methodname"><a href="intlcalendar.setrepeatedwalltimeoption.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::setRepeatedWallTimeOption()</a> - Set behavior for handling repeating wall times at negative timezone offset transitions</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.getnow.html">IntlCalendar::getNow</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getskippedwalltimeoption.html">IntlCalendar::getSkippedWallTimeOption</a></div> <div class="up"><a href="class.intlcalendar.html">IntlCalendar</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>