1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Class template local_adjustor</title> |
---|
5 | <link rel="stylesheet" href="boostbook.css" type="text/css"> |
---|
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> |
---|
7 | <link rel="start" href="index.html" title="The Boost C++ Libraries"> |
---|
8 | <link rel="up" href="date_time/doxy.html#id2485115" title="Header <boost/date_time/local_time_adjustor.hpp>"> |
---|
9 | <link rel="prev" href="static_local_time_adjustor.html" title="Class template static_local_time_adjustor"> |
---|
10 | <link rel="next" href="us_dst_trait.html" title="Struct template us_dst_trait"> |
---|
11 | </head> |
---|
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
13 | <table cellpadding="2" width="100%"> |
---|
14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td> |
---|
15 | <td align="center"><a href="../../index.htm">Home</a></td> |
---|
16 | <td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> |
---|
17 | <td align="center"><a href="../../people/people.htm">People</a></td> |
---|
18 | <td align="center"><a href="../../more/faq.htm">FAQ</a></td> |
---|
19 | <td align="center"><a href="../../more/index.htm">More</a></td> |
---|
20 | </table> |
---|
21 | <hr> |
---|
22 | <div class="spirit-nav"> |
---|
23 | <a accesskey="p" href="static_local_time_adjustor.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2485115"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="us_dst_trait.html"><img src="images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="local_adjustor"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Class template local_adjustor</span></h2> |
---|
29 | <p>boost::date_time::local_adjustor — Template that simplifies the creation of local time calculator. </p> |
---|
30 | </div> |
---|
31 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
---|
32 | <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> time_type, <span class="bold"><strong>short</strong></span> utc_offset, <span class="bold"><strong>typename</strong></span> dst_rule> |
---|
33 | <span class="bold"><strong>class</strong></span> local_adjustor { |
---|
34 | <span class="bold"><strong>public</strong></span>: |
---|
35 | <span class="emphasis"><em>// types</em></span> |
---|
36 | <span class="bold"><strong>typedef</strong></span> time_type::time_duration_type time_duration_type; |
---|
37 | <span class="bold"><strong>typedef</strong></span> time_type::date_type date_type; |
---|
38 | <span class="bold"><strong>typedef</strong></span> <a href="static_local_time_adjustor.html" title="Class template static_local_time_adjustor">static_local_time_adjustor</a>< time_type, dst_rule, <a href="utc_adjustment.html" title="Class template utc_adjustment">utc_adjustment</a>< time_duration_type, utc_offset > > dst_adjustor; |
---|
39 | |
---|
40 | <span class="emphasis"><em>// <a href="local_adjustor.html#id2493207-bb">public static functions</a></em></span> |
---|
41 | <span class="type">time_type</span> <a href="local_adjustor.html#id2493211-bb">utc_to_local</a>(<span class="bold"><strong>const</strong></span> time_type &) ; |
---|
42 | <span class="type">time_type</span> <a href="local_adjustor.html#id2394631-bb">local_to_utc</a>(<span class="bold"><strong>const</strong></span> time_type &, |
---|
43 | date_time::dst_flags = date_time::calculate) ; |
---|
44 | };</pre></div> |
---|
45 | <div class="refsect1" lang="en"> |
---|
46 | <a name="id2643723"></a><h2>Description</h2> |
---|
47 | <p>Use this template to create the timezone to utc convertors as required.</p> |
---|
48 | <p>This class will also work for other regions that don't use dst and have a utc offset which is an integral number of hours.</p> |
---|
49 | <p><span class="bold"><strong>Template Parameters</strong></span> -time_type -- Time class to use -utc_offset -- Number hours local time is adjust from utc -use_dst -- true (default) if region uses dst, false otherwise For example: </p> |
---|
50 | <pre class="programlisting"> //eastern timezone is utc-5 |
---|
51 | typedef date_time::local_adjustor<ptime, -5, us_dst> us_eastern; |
---|
52 | typedef date_time::local_adjustor<ptime, -6, us_dst> us_central; |
---|
53 | typedef date_time::local_adjustor<ptime, -7, us_dst> us_mountain; |
---|
54 | typedef date_time::local_adjustor<ptime, -8, us_dst> us_pacific; |
---|
55 | typedef date_time::local_adjustor<ptime, -7, no_dst> us_arizona; |
---|
56 | </pre> |
---|
57 | <div class="refsect2" lang="en"> |
---|
58 | <a name="id2643760"></a><h3> |
---|
59 | <a name="id2493207-bb"></a><code class="computeroutput">local_adjustor</code> public static functions</h3> |
---|
60 | <div class="orderedlist"><ol type="1"> |
---|
61 | <li><pre class="literallayout"><span class="type">time_type</span> <a name="id2493211-bb"></a>utc_to_local(<span class="bold"><strong>const</strong></span> time_type & t) ;</pre></li> |
---|
62 | <li><pre class="literallayout"><span class="type">time_type</span> <a name="id2394631-bb"></a>local_to_utc(<span class="bold"><strong>const</strong></span> time_type & t, |
---|
63 | date_time::dst_flags dst = date_time::calculate) ;</pre></li> |
---|
64 | </ol></div> |
---|
65 | </div> |
---|
66 | </div> |
---|
67 | </div> |
---|
68 | <table width="100%"><tr> |
---|
69 | <td align="left"></td> |
---|
70 | <td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td> |
---|
71 | </tr></table> |
---|
72 | <hr> |
---|
73 | <div class="spirit-nav"> |
---|
74 | <a accesskey="p" href="static_local_time_adjustor.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2485115"><img src="images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a><a accesskey="n" href="us_dst_trait.html"><img src="images/next.png" alt="Next"></a> |
---|
75 | </div> |
---|
76 | </body> |
---|
77 | </html> |
---|