Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 37eb773c4f50677290a7937043b43933 > files > 575

boost-devel-doc-1.60.0-6.1.mga6.noarch.rpm

<!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=US-ASCII">
<title>Class template static_local_time_adjustor</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.local_time_adjustor_hpp" title="Header &lt;boost/date_time/local_time_adjustor.hpp&gt;">
<link rel="prev" href="local_adjustor.html" title="Class template local_adjustor">
<link rel="next" href="utc_adjustment.html" title="Class template utc_adjustment">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="local_adjustor.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.local_time_adjustor_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="utc_adjustment.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.date_time.static_local_time_adjustor"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template static_local_time_adjustor</span></h2>
<p>boost::date_time::static_local_time_adjustor &#8212; Embed the rules for local time adjustments at compile time. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#header.boost.date_time.local_time_adjustor_hpp" title="Header &lt;boost/date_time/local_time_adjustor.hpp&gt;">boost/date_time/local_time_adjustor.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> time_type<span class="special">,</span> <span class="keyword">typename</span> dst_rules<span class="special">,</span> <span class="keyword">typename</span> utc_offset_rules<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="static_local_time_adjustor.html" title="Class template static_local_time_adjustor">static_local_time_adjustor</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">dst_rules</span>, <span class="keyword">public</span> <span class="identifier">utc_offset_rules</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">time_type</span><span class="special">::</span><span class="identifier">time_duration_type</span> <a name="boost.date_time.static_local_time_adjustor.time_duration_type"></a><span class="identifier">time_duration_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">time_type</span><span class="special">::</span><span class="identifier">date_type</span>          <a name="boost.date_time.static_local_time_adjustor.date_type"></a><span class="identifier">date_type</span><span class="special">;</span>         

  <span class="comment">// <a class="link" href="static_local_time_adjustor.html#idm45507106916480-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">time_duration_type</span> <a class="link" href="static_local_time_adjustor.html#idm45507129926528-bb"><span class="identifier">utc_to_local_offset</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">time_duration_type</span> 
  <a class="link" href="static_local_time_adjustor.html#idm45507162877696-bb"><span class="identifier">local_to_utc_offset</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_type</span> <span class="special">&amp;</span><span class="special">,</span> 
                      <span class="identifier">date_time</span><span class="special">::</span><span class="identifier">dst_flags</span> <span class="special">=</span> <span class="identifier">date_time</span><span class="special">::</span><span class="identifier">calculate</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm45555368132832"></a><h2>Description</h2>
<div class="refsect2">
<a name="idm45555368132416"></a><h3>
<a name="idm45507106916480-bb"></a><code class="computeroutput">static_local_time_adjustor</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">time_duration_type</span> <a name="idm45507129926528-bb"></a><span class="identifier">utc_to_local_offset</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_type</span> <span class="special">&amp;</span> t<span class="special">)</span><span class="special">;</span></pre>Calculates the offset from a utc time to local based on dst and utc offset. <p>
The logic is as follows. Starting with UTC time use the offset to create a label for an non-dst adjusted local time. Then call dst_rules::local_is_dst with the non adjust local time. The results of this function will either unabiguously decide that the initial local time is in dst or return an illegal or ambiguous result. An illegal result only occurs at the end of dst (where labels are skipped) and indicates that dst has ended. An ambiguous result means that we need to recheck by making a dst adjustment and then rechecking. If the dst offset is added to the utc time and the recheck proves non-ambiguous then we are past the boundary. If it is still ambiguous then we are ahead of the boundary and dst is still in effect.</p>
<p>TODO <span style="color: red">&lt;ndash&gt;&lt;/ndash&gt;</span> check if all dst offsets are positive. If not then the algorithm needs to check for this and reverse the illegal/ambiguous logic. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">t</code></span></p></td>
<td><p>UTC time to calculate offset to local time This adjustment depends on the following observations about the workings of the DST boundary offset. Since UTC time labels are monotonically increasing we can determine if a given local time is in DST or not and therefore adjust the offset appropriately.</p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">time_duration_type</span> 
<a name="idm45507162877696-bb"></a><span class="identifier">local_to_utc_offset</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_type</span> <span class="special">&amp;</span> t<span class="special">,</span> 
                    <span class="identifier">date_time</span><span class="special">::</span><span class="identifier">dst_flags</span> dst <span class="special">=</span> <span class="identifier">date_time</span><span class="special">::</span><span class="identifier">calculate</span><span class="special">)</span><span class="special">;</span></pre>Get the offset to UTC given a local time. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="local_adjustor.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.local_time_adjustor_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="utc_adjustment.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>