• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
3"../../../tools/boostbook/dtd/boostbook.dtd">
4
5<!-- Copyright (c) 2001-2005 CrystalClear Software, Inc.
6     Subject to the Boost Software License, Version 1.0.
7     (See accompanying file LICENSE_1_0.txt or  http://www.boost.org/LICENSE_1_0.txt)
8-->
9
10<section id="date_time.local_time.time_zone_base">
11  <title>Time Zone (abstract)</title>
12
13  <link linkend="time_zone_base_intro">Introduction</link> --
14  <link linkend="time_zone_base_header">Header</link> --
15  <link linkend="time_zone_base_constr">Construction</link> --
16  <link linkend="time_zone_base_accessors">Accessors</link>
17
18  <anchor id="time_zone_base_intro" />
19  <bridgehead renderas="sect3">Introduction</bridgehead>
20  <para>
21    The time_zone_base class is an abstract base class template for representing time zones. Time zones are a set of data and rules that provide information about a time zone. The date_time library handles time_zones by means of a boost::shared_ptr&lt;time_zone_base&gt;. A user's custom time zone class will work in the date_time library by means of this shared_ptr.
22  </para>
23  <para>
24    For convienience, the time_zone_base class is typedef'd as time_zone. All references in the documentation to time_zone, are referring to this typedef.
25  </para>
26
27  <anchor id="time_zone_base_header" />
28  <bridgehead renderas="sect3">Header</bridgehead>
29  <para>
30    The time_zone_base class is defined in the header:
31    <programlisting>#include "boost/date_time/time_zone_base.hpp"
32    </programlisting>
33  </para>
34
35  <anchor id="time_zone_base_constr" />
36  <bridgehead renderas="sect3">Construction</bridgehead>
37  <para>
38    A default constructor is provided in the time_zone_base class. There are no private data members in this base class to initialize.
39  </para>
40  <para>
41    Template parameters are time_type (typically posix_time::ptime) and CharT (defaults to char).
42  </para>
43
44  <anchor id="time_zone_base_accessors" />
45  <bridgehead renderas="sect3">Accessors</bridgehead>
46  <para>
47    All of the accessors listed here are pure virtual functions.
48  </para>
49  <para>
50    <informaltable frame="all">
51      <tgroup cols="2">
52        <thead>
53          <row>
54            <entry>Syntax</entry>
55            <entry>Description</entry>
56          </row>
57        </thead>
58        <tbody>
59          <row>
60            <entry valign="top"><screen>
61string_type dst_zone_abbrev();</screen></entry>
62            <entry>Returns the daylight savings abbreviation for the represented time zone.</entry>
63          </row>
64          <row>
65            <entry valign="top"><screen>
66string_type std_zone_abbrev();</screen></entry>
67            <entry>Returns the standard abbreviation for the represented time zone.</entry>
68          </row>
69          <row>
70            <entry valign="top"><screen>
71string_type dst_zone_name();</screen></entry>
72            <entry>Returns the daylight savings name for the represented time zone.</entry>
73          </row>
74          <row>
75            <entry valign="top"><screen>
76string_type std_zone_name();</screen></entry>
77            <entry>Returns the standard name for the represented time zone.</entry>
78          </row>
79          <row>
80            <entry valign="top"><screen>bool has_dst();</screen></entry>
81            <entry>Returns true if this time zone does not make a daylight savings shift.</entry>
82          </row>
83          <row>
84            <entry valign="top"><screen>
85time_type dst_local_start_time(year_type);</screen></entry>
86            <entry>The date and time daylight savings time begins in given year.</entry>
87          </row>
88          <row>
89            <entry valign="top"><screen>
90time_type dst_local_end_time(year_type);</screen></entry>
91            <entry valign="top">The date and time daylight savings time ends in given year.</entry>
92          </row>
93          <row>
94            <entry valign="top"><screen>
95time_duration_type base_utc_offset();</screen></entry>
96            <entry>The amount of time offset from UTC (typically in hours).</entry>
97          </row>
98          <row>
99            <entry valign="top"><screen>
100time_duration_type dst_offset();</screen></entry>
101            <entry>The amount of time shifted during daylight savings.</entry>
102          </row>
103          <row>
104            <entry valign="top"><screen>
105std::string to_posix_string();</screen></entry>
106            <entry>Returns a posix time zone string representation of this time_zone_base object. For a detailed description of a posix time zone string see <link linkend="date_time.local_time.posix_time_zone">posix_time_zone</link>.</entry>
107          </row>
108        </tbody>
109      </tgroup>
110    </informaltable>
111  </para>
112
113</section>
114