1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Class posix_time_zone</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#id2447946" title="Header <boost/date_time/local_time/posix_time_zone.hpp>"> |
---|
9 | <link rel="prev" href="bad_adjustment.html" title="Struct bad_adjustment"> |
---|
10 | <link rel="next" href="time_zone.html" title="Class time_zone"> |
---|
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="bad_adjustment.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2447946"><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="time_zone.html"><img src="images/next.png" alt="Next"></a> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="posix_time_zone"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Class posix_time_zone</span></h2> |
---|
29 | <p>boost::local_time::posix_time_zone — A time zone class constructed from a POSIX time zone string. </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"> |
---|
33 | <span class="bold"><strong>class</strong></span> posix_time_zone : <span class="bold"><strong>public</strong></span> boost::local_time::time_zone { |
---|
34 | <span class="bold"><strong>public</strong></span>: |
---|
35 | <span class="emphasis"><em>// types</em></span> |
---|
36 | <span class="bold"><strong>typedef</strong></span> boost::posix_time::time_duration time_duration_type; |
---|
37 | <span class="bold"><strong>typedef</strong></span> boost::tokenizer< boost::char_separator< <span class="bold"><strong>char</strong></span> > > tokenizer; |
---|
38 | <span class="bold"><strong>typedef</strong></span> <a href="time_zone.html" title="Class time_zone">time_zone</a> base_type; |
---|
39 | <span class="bold"><strong>typedef</strong></span> base_type::string_type string_type; |
---|
40 | <span class="bold"><strong>typedef</strong></span> base_type::stringstream_type stringstream_type; |
---|
41 | |
---|
42 | <span class="emphasis"><em>// <a href="posix_time_zone.html#posix_time_zoneconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
---|
43 | <a href="posix_time_zone.html#id2448349-bb">posix_time_zone</a>(<span class="bold"><strong>const</strong></span> std::string &); |
---|
44 | <a href="posix_time_zone.html#id2448367-bb">~posix_time_zone</a>(); |
---|
45 | |
---|
46 | <span class="emphasis"><em>// <a href="posix_time_zone.html#id2448123-bb">public member functions</a></em></span> |
---|
47 | <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="posix_time_zone.html#id2448127-bb">std_zone_abbrev</a>() <span class="bold"><strong>const</strong></span>; |
---|
48 | <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="posix_time_zone.html#id2448145-bb">dst_zone_abbrev</a>() <span class="bold"><strong>const</strong></span>; |
---|
49 | <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="posix_time_zone.html#id2448171-bb">std_zone_name</a>() <span class="bold"><strong>const</strong></span>; |
---|
50 | <span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a href="posix_time_zone.html#id2448198-bb">dst_zone_name</a>() <span class="bold"><strong>const</strong></span>; |
---|
51 | <span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>bool</strong></span></span> <a href="posix_time_zone.html#id2448227-bb">has_dst</a>() <span class="bold"><strong>const</strong></span>; |
---|
52 | <span class="type"><span class="bold"><strong>virtual</strong></span> posix_time::ptime</span> <a href="posix_time_zone.html#id2448244-bb">dst_local_start_time</a>(gregorian::greg_year) <span class="bold"><strong>const</strong></span>; |
---|
53 | <span class="type"><span class="bold"><strong>virtual</strong></span> posix_time::ptime</span> <a href="posix_time_zone.html#id2448271-bb">dst_local_end_time</a>(gregorian::greg_year) <span class="bold"><strong>const</strong></span>; |
---|
54 | <span class="type"><span class="bold"><strong>virtual</strong></span> time_duration_type</span> <a href="posix_time_zone.html#id2448297-bb">base_utc_offset</a>() <span class="bold"><strong>const</strong></span>; |
---|
55 | <span class="type"><span class="bold"><strong>virtual</strong></span> time_duration_type</span> <a href="posix_time_zone.html#id2448314-bb">dst_offset</a>() <span class="bold"><strong>const</strong></span>; |
---|
56 | <span class="type"><span class="bold"><strong>virtual</strong></span> string_type</span> <a href="posix_time_zone.html#id2448331-bb">to_posix_string</a>() <span class="bold"><strong>const</strong></span>; |
---|
57 | |
---|
58 | <span class="emphasis"><em>// <a href="posix_time_zone.html#id2448369-bb">private member functions</a></em></span> |
---|
59 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="posix_time_zone.html#id2448374-bb">calc_zone</a>(<span class="bold"><strong>const</strong></span> std::string &) ; |
---|
60 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="posix_time_zone.html#id2448408-bb">calc_rules</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>const</strong></span> std::string &) ; |
---|
61 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="posix_time_zone.html#id2448441-bb">M_func</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>const</strong></span> std::string &) ; |
---|
62 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="posix_time_zone.html#id2448474-bb">julian_no_leap</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>const</strong></span> std::string &) ; |
---|
63 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="posix_time_zone.html#id2448512-bb">julian_day</a>(<span class="bold"><strong>const</strong></span> std::string &, <span class="bold"><strong>const</strong></span> std::string &) ; |
---|
64 | |
---|
65 | <span class="emphasis"><em>// <a href="posix_time_zone.html#id2448551-bb">private static functions</a></em></span> |
---|
66 | <span class="type">std::string</span> <a href="posix_time_zone.html#id2448555-bb">td_as_string</a>(<span class="bold"><strong>const</strong></span> time_duration_type &) ; |
---|
67 | };</pre></div> |
---|
68 | <div class="refsect1" lang="en"> |
---|
69 | <a name="id2686272"></a><h2>Description</h2> |
---|
70 | <p>A POSIX time zone string takes the form of:<br> "std offset dst [offset],start[/time],end[/time]" (w/no spaces) 'std' specifies the abbrev of the time zone. |
---|
71 | 'offset' is the offset from UTC. |
---|
72 | 'dst' specifies the abbrev of the time zone during daylight savings time. |
---|
73 | The second offset is how many hours changed during DST. Default=1 |
---|
74 | 'start' and'end' are the dates when DST goes into (and out of) effect. |
---|
75 | 'offset' takes the form of: [+|-]hh[:mm[:ss]] {h=0-23, m/s=0-59} |
---|
76 | 'time' and 'offset' take the same form. Time defaults=02:00:00 |
---|
77 | 'start' and 'end' can be one of three forms:<br> Mm.w.d {month=1-12, week=1-5 (5 is always last), day=0-6} |
---|
78 | Jn {n=1-365 Feb29 is never counted} |
---|
79 | n {n=0-365 Feb29 is counted in leap years} |
---|
80 | Example "PST-5PDT01:00:00,M4.1.0/02:00:00,M10.1.0/02:00:00" |
---|
81 | Exceptions will be thrown under these conditions:<br> An invalid date spec (see date class) |
---|
82 | A boost::local_time::bad_offset exception will be thrown for:<br> A DST start or end offset that is negative or more than 24 hours |
---|
83 | A UTC zone that is greater than +12 or less than -12 hours |
---|
84 | A boost::local_time::bad_adjustment exception will be thrown for:<br> A DST adjustment that is 24 hours or more (positive or negative) |
---|
85 | </p> |
---|
86 | <div class="refsect2" lang="en"> |
---|
87 | <a name="id2686298"></a><h3> |
---|
88 | <a name="posix_time_zoneconstruct-copy-destruct"></a><code class="computeroutput">posix_time_zone</code> construct/copy/destruct</h3> |
---|
89 | <div class="orderedlist"><ol type="1"> |
---|
90 | <li><pre class="literallayout"><a name="id2448349-bb"></a>posix_time_zone(<span class="bold"><strong>const</strong></span> std::string & s);</pre></li> |
---|
91 | <li><pre class="literallayout"><a name="id2448367-bb"></a>~posix_time_zone();</pre></li> |
---|
92 | </ol></div> |
---|
93 | </div> |
---|
94 | <div class="refsect2" lang="en"> |
---|
95 | <a name="id2686352"></a><h3> |
---|
96 | <a name="id2448123-bb"></a><code class="computeroutput">posix_time_zone</code> public member functions</h3> |
---|
97 | <div class="orderedlist"><ol type="1"> |
---|
98 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id2448127-bb"></a>std_zone_abbrev() <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
99 | <li> |
---|
100 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id2448145-bb"></a>dst_zone_abbrev() <span class="bold"><strong>const</strong></span>;</pre> |
---|
101 | <p>For those time zones that have no DST, an empty string is used </p> |
---|
102 | </li> |
---|
103 | <li> |
---|
104 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id2448171-bb"></a>std_zone_name() <span class="bold"><strong>const</strong></span>;</pre> |
---|
105 | <p>The full STD name is not extracted from the posix time zone string. Therefore, the STD abbreviation is used in it's place </p> |
---|
106 | </li> |
---|
107 | <li> |
---|
108 | <pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> std::string</span> <a name="id2448198-bb"></a>dst_zone_name() <span class="bold"><strong>const</strong></span>;</pre> |
---|
109 | <p>The full DST name is not extracted from the posix time zone string. Therefore, the STD abbreviation is used in it's place. For time zones that have no DST, an empty string is used </p> |
---|
110 | </li> |
---|
111 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> <span class="bold"><strong>bool</strong></span></span> <a name="id2448227-bb"></a>has_dst() <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
112 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> posix_time::ptime</span> <a name="id2448244-bb"></a>dst_local_start_time(gregorian::greg_year y) <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
113 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> posix_time::ptime</span> <a name="id2448271-bb"></a>dst_local_end_time(gregorian::greg_year y) <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
114 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> time_duration_type</span> <a name="id2448297-bb"></a>base_utc_offset() <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
115 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> time_duration_type</span> <a name="id2448314-bb"></a>dst_offset() <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
116 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>virtual</strong></span> string_type</span> <a name="id2448331-bb"></a>to_posix_string() <span class="bold"><strong>const</strong></span>;</pre></li> |
---|
117 | </ol></div> |
---|
118 | </div> |
---|
119 | <div class="refsect2" lang="en"> |
---|
120 | <a name="id2686667"></a><h3> |
---|
121 | <a name="id2448369-bb"></a><code class="computeroutput">posix_time_zone</code> private member functions</h3> |
---|
122 | <div class="orderedlist"><ol type="1"> |
---|
123 | <li> |
---|
124 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2448374-bb"></a>calc_zone(<span class="bold"><strong>const</strong></span> std::string & obj) ;</pre> |
---|
125 | <p>Extract time zone abbreviations for STD & DST as well as the offsets for the time the shift occurs and how much of a shift. At this time full time zone names are NOT extracted so the abbreviations are used in their place </p> |
---|
126 | </li> |
---|
127 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2448408-bb"></a>calc_rules(<span class="bold"><strong>const</strong></span> std::string & start, <span class="bold"><strong>const</strong></span> std::string & end) ;</pre></li> |
---|
128 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2448441-bb"></a>M_func(<span class="bold"><strong>const</strong></span> std::string & s, <span class="bold"><strong>const</strong></span> std::string & e) ;</pre></li> |
---|
129 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2448474-bb"></a>julian_no_leap(<span class="bold"><strong>const</strong></span> std::string & s, <span class="bold"><strong>const</strong></span> std::string & e) ;</pre></li> |
---|
130 | <li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2448512-bb"></a>julian_day(<span class="bold"><strong>const</strong></span> std::string & s, <span class="bold"><strong>const</strong></span> std::string & e) ;</pre></li> |
---|
131 | </ol></div> |
---|
132 | </div> |
---|
133 | <div class="refsect2" lang="en"> |
---|
134 | <a name="id2686858"></a><h3> |
---|
135 | <a name="id2448551-bb"></a><code class="computeroutput">posix_time_zone</code> private static functions</h3> |
---|
136 | <div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="type">std::string</span> <a name="id2448555-bb"></a>td_as_string(<span class="bold"><strong>const</strong></span> time_duration_type & td) ;</pre></li></ol></div> |
---|
137 | </div> |
---|
138 | </div> |
---|
139 | </div> |
---|
140 | <table width="100%"><tr> |
---|
141 | <td align="left"></td> |
---|
142 | <td align="right"><small>Copyright © 2001-2005 CrystalClear Software, Inc</small></td> |
---|
143 | </tr></table> |
---|
144 | <hr> |
---|
145 | <div class="spirit-nav"> |
---|
146 | <a accesskey="p" href="bad_adjustment.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="date_time/doxy.html#id2447946"><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="time_zone.html"><img src="images/next.png" alt="Next"></a> |
---|
147 | </div> |
---|
148 | </body> |
---|
149 | </html> |
---|