Imported Upstream version 1.64.0
[platform/upstream/boost.git] / doc / html / boost / local_time / local_date_time_base.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5 <title>Class template local_date_time_base</title>
6 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
7 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9 <link rel="up" href="../../date_time/doxy.html#header.boost.date_time.local_time.local_date_time_hpp" title="Header &lt;boost/date_time/local_time/local_date_time.hpp&gt;">
10 <link rel="prev" href="dst_not_valid.html" title="Struct dst_not_valid">
11 <link rel="next" href="bad_offset.html" title="Struct bad_offset">
12 </head>
13 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14 <table cellpadding="2" width="100%"><tr>
15 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
16 <td align="center"><a href="../../../../index.html">Home</a></td>
17 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
18 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20 <td align="center"><a href="../../../../more/index.htm">More</a></td>
21 </tr></table>
22 <hr>
23 <div class="spirit-nav">
24 <a accesskey="p" href="dst_not_valid.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.local_date_time_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="bad_offset.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25 </div>
26 <div class="refentry">
27 <a name="boost.local_time.local_date_time_base"></a><div class="titlepage"></div>
28 <div class="refnamediv">
29 <h2><span class="refentrytitle">Class template local_date_time_base</span></h2>
30 <p>boost::local_time::local_date_time_base &#8212; Representation of "wall-clock" time in a particular time zone. </p>
31 </div>
32 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
33 <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.local_date_time_hpp" title="Header &lt;boost/date_time/local_time/local_date_time.hpp&gt;">boost/date_time/local_time/local_date_time.hpp</a>&gt;
34
35 </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> utc_time_ <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">ptime</span><span class="special">,</span> 
36          <span class="keyword">typename</span> tz_type <span class="special">=</span> <span class="identifier">date_time</span><span class="special">::</span><span class="identifier">time_zone_base</span><span class="special">&lt;</span><span class="identifier">utc_time_</span><span class="special">,</span><span class="keyword">char</span><span class="special">&gt;</span> <span class="special">&gt;</span> 
37 <span class="keyword">class</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">:</span> <span class="keyword">public</span> date_time::base_time&lt; utc_time_, boost::posix_time::posix_time_system &gt;
38 <span class="special">{</span>
39 <span class="keyword">public</span><span class="special">:</span>
40   <span class="comment">// types</span>
41   <span class="keyword">typedef</span> <span class="identifier">utc_time_</span>                         <a name="boost.local_time.local_date_time_base.utc_time_type"></a><span class="identifier">utc_time_type</span><span class="special">;</span>     
42   <span class="keyword">typedef</span> <span class="identifier">utc_time_type</span><span class="special">::</span><span class="identifier">time_duration_type</span> <a name="boost.local_time.local_date_time_base.time_duration_type"></a><span class="identifier">time_duration_type</span><span class="special">;</span>
43   <span class="keyword">typedef</span> <span class="identifier">utc_time_type</span><span class="special">::</span><span class="identifier">date_type</span>          <a name="boost.local_time.local_date_time_base.date_type"></a><span class="identifier">date_type</span><span class="special">;</span>         
44   <span class="keyword">typedef</span> <span class="identifier">date_type</span><span class="special">::</span><span class="identifier">duration_type</span>          <a name="boost.local_time.local_date_time_base.date_duration_type"></a><span class="identifier">date_duration_type</span><span class="special">;</span>
45   <span class="keyword">typedef</span> <span class="identifier">utc_time_type</span><span class="special">::</span><span class="identifier">time_system_type</span>   <a name="boost.local_time.local_date_time_base.time_system_type"></a><span class="identifier">time_system_type</span><span class="special">;</span>  
46
47   <span class="keyword">enum</span> <a name="boost.local_time.local_date_time_base.DST_CALC_OPTIONS"></a>DST_CALC_OPTIONS <span class="special">{</span> EXCEPTION_ON_ERROR, NOT_DATE_TIME_ON_ERROR <span class="special">}</span><span class="special">;</span>
48
49   <span class="comment">// <a class="link" href="local_date_time_base.html#boost.local_time.local_date_time_baseconstruct-copy-destruct">construct/copy/destruct</a></span>
50   <a class="link" href="local_date_time_base.html#idp498933584-bb"><span class="identifier">local_date_time_base</span></a><span class="special">(</span><span class="identifier">utc_time_type</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
51   <a class="link" href="local_date_time_base.html#idp498936864-bb"><span class="identifier">local_date_time_base</span></a><span class="special">(</span><span class="identifier">date_type</span><span class="special">,</span> <span class="identifier">time_duration_type</span><span class="special">,</span> 
52                        <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">)</span><span class="special">;</span>
53   <a class="link" href="local_date_time_base.html#idp498942976-bb"><span class="identifier">local_date_time_base</span></a><span class="special">(</span><span class="identifier">date_type</span><span class="special">,</span> <span class="identifier">time_duration_type</span><span class="special">,</span> 
54                        <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">DST_CALC_OPTIONS</span><span class="special">)</span><span class="special">;</span>
55   <a class="link" href="local_date_time_base.html#idp498947216-bb"><span class="identifier">local_date_time_base</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
56   <span class="keyword">explicit</span> <a class="link" href="local_date_time_base.html#idp498948928-bb"><span class="identifier">local_date_time_base</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">date_time</span><span class="special">::</span><span class="identifier">special_values</span><span class="special">,</span> 
57                                 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
58   <a class="link" href="local_date_time_base.html#idp498946592-bb"><span class="special">~</span><span class="identifier">local_date_time_base</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
59
60   <span class="comment">// <a class="link" href="local_date_time_base.html#idp498878064-bb">public member functions</a></span>
61   <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> <a class="link" href="local_date_time_base.html#idp498878624-bb"><span class="identifier">zone</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
62   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498880080-bb"><span class="identifier">is_dst</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
63   <span class="identifier">utc_time_type</span> <a class="link" href="local_date_time_base.html#idp498881552-bb"><span class="identifier">utc_time</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
64   <span class="identifier">utc_time_type</span> <a class="link" href="local_date_time_base.html#idp498882992-bb"><span class="identifier">local_time</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
65   <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="local_date_time_base.html#idp498884432-bb"><span class="identifier">to_string</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
66   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> 
67   <a class="link" href="local_date_time_base.html#idp498886464-bb"><span class="identifier">local_time_in</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">,</span> 
68                 <span class="identifier">time_duration_type</span> <span class="special">=</span> <span class="identifier">time_duration_type</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
69   <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="local_date_time_base.html#idp498890608-bb"><span class="identifier">zone_name</span></a><span class="special">(</span><span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
70   <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="local_date_time_base.html#idp498893600-bb"><span class="identifier">zone_abbrev</span></a><span class="special">(</span><span class="keyword">bool</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
71   <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="local_date_time_base.html#idp498896560-bb"><span class="identifier">zone_as_posix_string</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
72   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498898048-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
73   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498901040-bb"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
74   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498903600-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
75   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498906160-bb"><span class="keyword">operator</span><span class="special">&lt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
76   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498908736-bb"><span class="keyword">operator</span><span class="special">&gt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
77   <span class="keyword">bool</span> <a class="link" href="local_date_time_base.html#idp498911296-bb"><span class="keyword">operator</span><span class="special">&gt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
78   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498913872-bb"><span class="keyword">operator</span><span class="special">+</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
79   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498916128-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
80   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498918112-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
81   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498920368-bb"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
82   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498922352-bb"><span class="keyword">operator</span><span class="special">+</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
83   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498924608-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
84   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498926592-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
85   <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a class="link" href="local_date_time_base.html#idp498928848-bb"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
86   <span class="identifier">time_duration_type</span> <a class="link" href="local_date_time_base.html#idp498930832-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
87
88   <span class="comment">// <a class="link" href="local_date_time_base.html#idp498951504-bb">public static functions</a></span>
89   <span class="keyword">static</span> <span class="identifier">time_is_dst_result</span> 
90   <a class="link" href="local_date_time_base.html#idp498952064-bb"><span class="identifier">check_dst</span></a><span class="special">(</span><span class="identifier">date_type</span><span class="special">,</span> <span class="identifier">time_duration_type</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">)</span><span class="special">;</span>
91
92   <span class="comment">// <a class="link" href="local_date_time_base.html#idp498956368-bb">private member functions</a></span>
93   <span class="identifier">utc_time_type</span> 
94   <a class="link" href="local_date_time_base.html#idp498956944-bb"><span class="identifier">construction_adjustment</span></a><span class="special">(</span><span class="identifier">utc_time_type</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">)</span><span class="special">;</span>
95   <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="local_date_time_base.html#idp498960304-bb"><span class="identifier">zone_as_offset</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
96 <span class="special">}</span><span class="special">;</span></pre></div>
97 <div class="refsect1">
98 <a name="idp238789504"></a><h2>Description</h2>
99 <p>Representation of "wall-clock" time in a particular time zone Local_date_time_base holds a time value (date and time offset from 00:00) along with a time zone. The time value is stored as UTC and conversions to wall clock time are made as needed. This approach allows for operations between wall-clock times in different time zones, and daylight savings time considerations, to be made. Time zones are required to be in the form of a boost::shared_ptr&lt;time_zone_base&gt;. </p>
100 <div class="refsect2">
101 <a name="idp238791104"></a><h3>
102 <a name="boost.local_time.local_date_time_baseconstruct-copy-destruct"></a><code class="computeroutput">local_date_time_base</code> 
103         public
104        construct/copy/destruct</h3>
105 <div class="orderedlist"><ol class="orderedlist" type="1">
106 <li class="listitem">
107 <pre class="literallayout"><a name="idp498933584-bb"></a><span class="identifier">local_date_time_base</span><span class="special">(</span><span class="identifier">utc_time_type</span> t<span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> tz<span class="special">)</span><span class="special">;</span></pre>
108 <p>This constructor interprets the passed time as a UTC time. So, for example, if the passed timezone is UTC-5 then the time will be adjusted back 5 hours. The time zone allows for automatic calculation of whether the particular time is adjusted for daylight savings, etc. If the time zone shared pointer is null then time stays unadjusted. 
109 </p>
110 <div class="variablelist"><table border="0" class="variablelist compact">
111 <colgroup>
112 <col align="left" valign="top">
113 <col>
114 </colgroup>
115 <tbody><tr>
116 <td><p><span class="term">Parameters:</span></p></td>
117 <td><div class="variablelist"><table border="0" class="variablelist compact">
118 <colgroup>
119 <col align="left" valign="top">
120 <col>
121 </colgroup>
122 <tbody>
123 <tr>
124 <td><p><span class="term"><code class="computeroutput">t</code></span></p></td>
125 <td><p>A UTC time </p></td>
126 </tr>
127 <tr>
128 <td><p><span class="term"><code class="computeroutput">tz</code></span></p></td>
129 <td><p>Timezone for to adjust the UTC time to. </p></td>
130 </tr>
131 </tbody>
132 </table></div></td>
133 </tr></tbody>
134 </table></div>
135 </li>
136 <li class="listitem">
137 <pre class="literallayout"><a name="idp498936864-bb"></a><span class="identifier">local_date_time_base</span><span class="special">(</span><span class="identifier">date_type</span> d<span class="special">,</span> <span class="identifier">time_duration_type</span> td<span class="special">,</span> 
138                      <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> tz<span class="special">,</span> <span class="keyword">bool</span> dst_flag<span class="special">)</span><span class="special">;</span></pre>
139 <p>This constructs a local time &#8211; the passed time information understood to be in the passed tz. The DST flag must be passed to indicate whether the time is in daylight savings or not. 
140 </p>
141 <div class="variablelist"><table border="0" class="variablelist compact">
142 <colgroup>
143 <col align="left" valign="top">
144 <col>
145 </colgroup>
146 <tbody><tr>
147 <td><p><span class="term">Throws:</span></p></td>
148 <td>&amp;ndash; <a class="link" href="time_label_invalid.html" title="Struct time_label_invalid">time_label_invalid</a> if the time passed does not exist in the given locale. The non-existent case occurs typically during the shift-back from daylight savings time. When the clock is shifted forward a range of times (2 am to 3 am in the US) is skipped and hence is invalid. <a class="link" href="dst_not_valid.html" title="Struct dst_not_valid">dst_not_valid</a> if the DST flag is passed for a period where DST is not active. </td>
149 </tr></tbody>
150 </table></div>
151 </li>
152 <li class="listitem">
153 <pre class="literallayout"><a name="idp498942976-bb"></a><span class="identifier">local_date_time_base</span><span class="special">(</span><span class="identifier">date_type</span> d<span class="special">,</span> <span class="identifier">time_duration_type</span> td<span class="special">,</span> 
154                      <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> tz<span class="special">,</span> 
155                      <span class="identifier">DST_CALC_OPTIONS</span> calc_option<span class="special">)</span><span class="special">;</span></pre>
156 <p>This constructs a local time &#8211; the passed time information understood to be in the passed tz. The DST flag is calculated according to the specified rule. </p>
157 </li>
158 <li class="listitem">
159 <pre class="literallayout"><a name="idp498947216-bb"></a><span class="identifier">local_date_time_base</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Copy constructor. </li>
160 <li class="listitem">
161 <pre class="literallayout"><span class="keyword">explicit</span> <a name="idp498948928-bb"></a><span class="identifier">local_date_time_base</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">date_time</span><span class="special">::</span><span class="identifier">special_values</span> sv<span class="special">,</span> 
162                               <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> tz <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Special values constructor. </li>
163 <li class="listitem">
164 <pre class="literallayout"><a name="idp498946592-bb"></a><span class="special">~</span><span class="identifier">local_date_time_base</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Simple destructor, releases time zone if last referrer. </li>
165 </ol></div>
166 </div>
167 <div class="refsect2">
168 <a name="idp238862256"></a><h3>
169 <a name="idp498878064-bb"></a><code class="computeroutput">local_date_time_base</code> public member functions</h3>
170 <div class="orderedlist"><ol class="orderedlist" type="1">
171 <li class="listitem">
172 <pre class="literallayout"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> <a name="idp498878624-bb"></a><span class="identifier">zone</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>returns time zone associated with calling instance </li>
173 <li class="listitem">
174 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498880080-bb"></a><span class="identifier">is_dst</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>returns false is time_zone is NULL and if time value is a special_value </li>
175 <li class="listitem">
176 <pre class="literallayout"><span class="identifier">utc_time_type</span> <a name="idp498881552-bb"></a><span class="identifier">utc_time</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns object's time value as a utc representation. </li>
177 <li class="listitem">
178 <pre class="literallayout"><span class="identifier">utc_time_type</span> <a name="idp498882992-bb"></a><span class="identifier">local_time</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns object's time value as a local representation. </li>
179 <li class="listitem">
180 <pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idp498884432-bb"></a><span class="identifier">to_string</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns string in the form "2003-Aug-20 05:00:00 EDT". <p>Returns string in the form "2003-Aug-20 05:00:00 EDT". If time_zone is NULL the time zone abbreviation will be "UTC". The time zone abbrev will not be included if calling object is a special_value </p>
181 </li>
182 <li class="listitem">
183 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> 
184 <a name="idp498886464-bb"></a><span class="identifier">local_time_in</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> new_tz<span class="special">,</span> 
185               <span class="identifier">time_duration_type</span> td <span class="special">=</span> <span class="identifier">time_duration_type</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
186 <p>returns a <code class="computeroutput"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a></code> in the given time zone with the optional time_duration added. </p>
187 </li>
188 <li class="listitem">
189 <pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idp498890608-bb"></a><span class="identifier">zone_name</span><span class="special">(</span><span class="keyword">bool</span> as_offset <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns name of associated time zone or "Coordinated Universal Time". <p>Optional bool parameter will return time zone as an offset (ie "+07:00" extended iso format). Empty string is returned for classes that do not use a time_zone </p>
190 </li>
191 <li class="listitem">
192 <pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idp498893600-bb"></a><span class="identifier">zone_abbrev</span><span class="special">(</span><span class="keyword">bool</span> as_offset <span class="special">=</span> <span class="keyword">false</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns abbreviation of associated time zone or "UTC". <p>Optional bool parameter will return time zone as an offset (ie "+0700" iso format). Empty string is returned for classes that do not use a time_zone </p>
193 </li>
194 <li class="listitem">
195 <pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idp498896560-bb"></a><span class="identifier">zone_as_posix_string</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>returns a posix_time_zone string for the associated time_zone. If no time_zone, "UTC+00" is returned. </li>
196 <li class="listitem">
197 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498898048-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Equality comparison operator. <p>Equality comparison operator </p>
198 </li>
199 <li class="listitem">
200 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498901040-bb"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Non-Equality comparison operator. </li>
201 <li class="listitem">
202 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498903600-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Less than comparison operator. </li>
203 <li class="listitem">
204 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498906160-bb"></a><span class="keyword">operator</span><span class="special">&lt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Less than or equal to comparison operator. </li>
205 <li class="listitem">
206 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498908736-bb"></a><span class="keyword">operator</span><span class="special">&gt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Greater than comparison operator. </li>
207 <li class="listitem">
208 <pre class="literallayout"><span class="keyword">bool</span> <a name="idp498911296-bb"></a><span class="keyword">operator</span><span class="special">&gt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Greater than or equal to comparison operator. </li>
209 <li class="listitem">
210 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498913872-bb"></a><span class="keyword">operator</span><span class="special">+</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span> dd<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Local_date_time + date_duration. </li>
211 <li class="listitem">
212 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498916128-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span> dd<span class="special">)</span><span class="special">;</span></pre>Local_date_time += date_duration. </li>
213 <li class="listitem">
214 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498918112-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span> dd<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Local_date_time - date_duration. </li>
215 <li class="listitem">
216 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498920368-bb"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">date_duration_type</span> <span class="special">&amp;</span> dd<span class="special">)</span><span class="special">;</span></pre>Local_date_time -= date_duration. </li>
217 <li class="listitem">
218 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498922352-bb"></a><span class="keyword">operator</span><span class="special">+</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span> td<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Local_date_time + time_duration. </li>
219 <li class="listitem">
220 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498924608-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span> td<span class="special">)</span><span class="special">;</span></pre>Local_date_time += time_duration. </li>
221 <li class="listitem">
222 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498926592-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span> td<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Local_date_time - time_duration. </li>
223 <li class="listitem">
224 <pre class="literallayout"><a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <a name="idp498928848-bb"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span> td<span class="special">)</span><span class="special">;</span></pre>Local_date_time -= time_duration. </li>
225 <li class="listitem">
226 <pre class="literallayout"><span class="identifier">time_duration_type</span> <a name="idp498930832-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="local_date_time_base.html" title="Class template local_date_time_base">local_date_time_base</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>local_date_time -= local_date_time &#8211;&gt; time_duration_type </li>
227 </ol></div>
228 </div>
229 <div class="refsect2">
230 <a name="idp239051472"></a><h3>
231 <a name="idp498951504-bb"></a><code class="computeroutput">local_date_time_base</code> public static functions</h3>
232 <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
233 <pre class="literallayout"><span class="keyword">static</span> <span class="identifier">time_is_dst_result</span> 
234 <a name="idp498952064-bb"></a><span class="identifier">check_dst</span><span class="special">(</span><span class="identifier">date_type</span> d<span class="special">,</span> <span class="identifier">time_duration_type</span> td<span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> tz<span class="special">)</span><span class="special">;</span></pre>Determines if given time label is in daylight savings for given zone. <p>Determines if given time label is in daylight savings for given zone. Takes a date and time_duration representing a local time, along with time zone, and returns a time_is_dst_result object as result. </p>
235 </li></ol></div>
236 </div>
237 <div class="refsect2">
238 <a name="idp239065616"></a><h3>
239 <a name="idp498956368-bb"></a><code class="computeroutput">local_date_time_base</code> private member functions</h3>
240 <div class="orderedlist"><ol class="orderedlist" type="1">
241 <li class="listitem">
242 <pre class="literallayout"><span class="identifier">utc_time_type</span> 
243 <a name="idp498956944-bb"></a><span class="identifier">construction_adjustment</span><span class="special">(</span><span class="identifier">utc_time_type</span> t<span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span> <span class="identifier">tz_type</span> <span class="special">&gt;</span> z<span class="special">,</span> 
244                         <span class="keyword">bool</span> dst_flag<span class="special">)</span><span class="special">;</span></pre>
245 <p>Adjust the passed in time to UTC? </p>
246 </li>
247 <li class="listitem">
248 <pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idp498960304-bb"></a><span class="identifier">zone_as_offset</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_duration_type</span> <span class="special">&amp;</span> td<span class="special">,</span> 
249                            <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> separator<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
250 <p>Simple formatting code &#8211; todo remove this? </p>
251 </li>
252 </ol></div>
253 </div>
254 </div>
255 </div>
256 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
257 <td align="left"></td>
258 <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
259     <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>
260 </div></td>
261 </tr></table>
262 <hr>
263 <div class="spirit-nav">
264 <a accesskey="p" href="dst_not_valid.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.local_date_time_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="bad_offset.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
265 </div>
266 </body>
267 </html>