<!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>The maximum value for a field, considering the objectʼs current time</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="intlcalendar.get.html">IntlCalendar::get</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getactualminimum.html">IntlCalendar::getActualMinimum</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.getactualmaximum" class="refentry"> <div class="refnamediv"> <h1 class="refname">IntlCalendar::getActualMaximum</h1> <p class="verinfo">(PHP 5.5.0, PECL >= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getActualMaximum</span> — <span class="dc-title">The maximum value for a field, considering the objectʼs current time</span></p> </div> <div class="refsect1 description" id="refsect1-intlcalendar.getactualmaximum-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::getActualMaximum</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$field</code></span> )</div> <p class="para rdfs-comment"> Returns a fieldʼs relative maximum value around the current time. The exact semantics vary by field, but in the general case this is the value that would be obtained if one would set the field value into the <a href="intlcalendar.getleastmaximum.html" class="link">smallest relative maximum</a> for the field and would increment it until reaching the <a href="intlcalendar.getmaximum.html" class="link">global maximum</a> or the field value wraps around, in which the value returned would be the global maximum or the value before the wrapping, respectively. </p> <p class="para"> For instance, in the gregorian calendar, the actual maximum value for the <a href="class.intlcalendar.html#intlcalendar.constants.field-day-of-month" class="link">day of month</a> would vary between <em>28</em> and <em>31</em>, depending on the month and year of the current time. </p> </div> <div class="refsect1 parameters" id="refsect1-intlcalendar.getactualmaximum-parameters"> <h3 class="title">Parameters</h3> <dl> <dt> <span class="term"><em><code class="parameter">field</code></em></span> <dd> <p class="para"> One of the <a href="class.intlcalendar.html" class="classname">IntlCalendar</a> date/time <a href="class.intlcalendar.html#intlcalendar.constants" class="link">field constants</a>. These are integer values between <em>0</em> and <strong><code>IntlCalendar::FIELD_COUNT</code></strong>. </p> </dd> </dt> </dl> </div> <div class="refsect1 returnvalues" id="refsect1-intlcalendar.getactualmaximum-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> An <span class="type"><a href="language.types.integer.html" class="type int">int</a></span> representing the maximum value in the units associated with the given <em><code class="parameter">field</code></em> or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 examples" id="refsect1-intlcalendar.getactualmaximum-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-2599"> <p><strong>Example #1 <span class="function"><strong>IntlCalendar::getActualMaximum()</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 /><br /></span><span style="color: #0000BB">$cal </span><span style="color: #007700">= </span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">fromDateTime</span><span style="color: #007700">(</span><span style="color: #DD0000">'2013-02-15'</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">getActualMaximum</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">FIELD_DAY_OF_MONTH</span><span style="color: #007700">)); </span><span style="color: #FF8000">//28<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-></span><span style="color: #0000BB">add</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">FIELD_EXTENDED_YEAR</span><span style="color: #007700">, -</span><span style="color: #0000BB">1</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">getActualMaximum</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlCalendar</span><span style="color: #007700">::</span><span style="color: #0000BB">FIELD_DAY_OF_MONTH</span><span style="color: #007700">)); </span><span style="color: #FF8000">//29</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(28) int(29) </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-intlcalendar.getactualmaximum-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="intlcalendar.getmaximum.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::getMaximum()</a> - Get the global maximum value for a field</span></li> <li class="member"> <span class="methodname"><a href="intlcalendar.getleastmaximum.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::getLeastMaximum()</a> - Get the smallest local maximum for a field</span></li> <li class="member"> <span class="methodname"><a href="intlcalendar.getactualminimum.html" class="methodname" rel="rdfs-seeAlso">IntlCalendar::getActualMinimum()</a> - The minimum value for a field, considering the objectʼs current time</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.get.html">IntlCalendar::get</a></div> <div class="next" style="text-align: right; float: right;"><a href="intlcalendar.getactualminimum.html">IntlCalendar::getActualMinimum</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>