<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> <link rel="Start" href="index.html"> <link rel="previous" href="Utils.html"> <link rel="next" href="Period.html"> <link rel="Up" href="index.html"> <link title="Index of types" rel=Appendix href="index_types.html"> <link title="Index of exceptions" rel=Appendix href="index_exceptions.html"> <link title="Index of values" rel=Appendix href="index_values.html"> <link title="Index of modules" rel=Appendix href="index_modules.html"> <link title="Index of module types" rel=Appendix href="index_module_types.html"> <link title="Utils" rel="Chapter" href="Utils.html"> <link title="Time_Zone" rel="Chapter" href="Time_Zone.html"> <link title="Period" rel="Chapter" href="Period.html"> <link title="Time_sig" rel="Chapter" href="Time_sig.html"> <link title="Time" rel="Chapter" href="Time.html"> <link title="Ftime" rel="Chapter" href="Ftime.html"> <link title="Date_sig" rel="Chapter" href="Date_sig.html"> <link title="Date" rel="Chapter" href="Date.html"> <link title="Calendar_sig" rel="Chapter" href="Calendar_sig.html"> <link title="Calendar_builder" rel="Chapter" href="Calendar_builder.html"> <link title="Calendar" rel="Chapter" href="Calendar.html"> <link title="Fcalendar" rel="Chapter" href="Fcalendar.html"> <link title="Printer" rel="Chapter" href="Printer.html"> <link title="Version" rel="Chapter" href="Version.html"><title>Time_Zone</title> </head> <body> <div class="navbar"><a href="Utils.html">Previous</a> <a href="index.html">Up</a> <a href="Period.html">Next</a> </div> <center><h1>Module <a href="type_Time_Zone.html">Time_Zone</a></h1></center> <br> <pre><span class="keyword">module</span> Time_Zone: <code class="code"><span class="keyword">sig</span></code> <a href="Time_Zone.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>Time zone management. <p> You can <code class="code">change</code> the <code class="code">current</code> time zone in your program by side effect.<br> <hr width="100%"> <br><code><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t = </code><table class="typetable"> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">UTC</span></code></td> <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Greenwich Meridian Time</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">Local</span></code></td> <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Local Time</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td> </tr> <tr> <td align="left" valign="top" > <code><span class="keyword">|</span></code></td> <td align="left" valign="top" > <code><span class="constructor">UTC_Plus</span> <span class="keyword">of</span> <code class="type">int</code></code></td> <td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Another time zone specified from UTC</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td> </tr></table> <div class="info"> Type of a time zone.<br> </div> <pre><span class="keyword">val</span> <a name="VALcurrent"></a>current : <code class="type">unit -> <a href="Time_Zone.html#TYPEt">t</a></code></pre><div class="info"> Return the current time zone. It is <code class="code"><span class="constructor">UTC</span></code> before any change.<br> </div> <pre><span class="keyword">val</span> <a name="VALchange"></a>change : <code class="type"><a href="Time_Zone.html#TYPEt">t</a> -> unit</code></pre><div class="info"> Change the current time zone by another one. Raise <code class="code"><span class="constructor">Invalid_argument</span></code> if the specified time zone is <code class="code"><span class="constructor">UTC_Plus</span> x</code> with <code class="code">x < -12</code> or <code class="code">x > 11</code><br> </div> <pre><span class="keyword">val</span> <a name="VALgap"></a>gap : <code class="type"><a href="Time_Zone.html#TYPEt">t</a> -> <a href="Time_Zone.html#TYPEt">t</a> -> int</code></pre><div class="info"> Return the gap between two time zone.<br> <b>Example:</b> <code class="code">gap <span class="constructor">UTC</span> (<span class="constructor">UTC_Plus</span> 5)</code> returns 5 and, at Paris in summer, <code class="code">gap <span class="constructor">Local</span> <span class="constructor">UTC</span></code> returns -2.<br> </div> <pre><span class="keyword">val</span> <a name="VALfrom_gmt"></a>from_gmt : <code class="type">unit -> int</code></pre><div class="info"> <code class="code">from_gmt ()</code> is equivalent to <code class="code">gap <span class="constructor">UTC</span> (current ())</code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALto_gmt"></a>to_gmt : <code class="type">unit -> int</code></pre><div class="info"> <code class="code">to_gmt ()</code> is equivalent to <code class="code">gap (current ()) <span class="constructor">UTC</span></code>.<br> </div> <pre><span class="keyword">val</span> <a name="VALis_dst"></a>is_dst : <code class="type">unit -> bool</code></pre><div class="info"> <code class="code">is_dst ()</code> checks if daylight saving time is in effect. Only relevant in local time. Returns alway <code class="code"><span class="keyword">false</span></code> in another time zone.<br> <b>Since</b> 1.09.4<br> </div> <pre><span class="keyword">val</span> <a name="VALhour_of_dst"></a>hour_of_dst : <code class="type">unit -> int</code></pre><div class="info"> <code class="code">hour_of_dst ()</code> returns <code class="code">1</code> if <code class="code">is_dst ()</code> and <code class="code">0</code> otherwise.<br> <b>Since</b> 1.09.4<br> </div> <pre><span class="keyword">val</span> <a name="VALon"></a>on : <code class="type">('a -> 'b) -> <a href="Time_Zone.html#TYPEt">t</a> -> 'a -> 'b</code></pre><div class="info"> <code class="code">on f tz x</code> changes the time zone to <code class="code">tz</code>, then computes <code class="code">f x</code>, and finally reset the time zone to the initial one and returns the result of the computation.<br> <b>Since</b> 2.0<br> </div> </body></html>