File: local_time.xml

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (77 lines) | stat: -rw-r--r-- 4,074 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" 
"../../../tools/boostbook/dtd/boostbook.dtd">

<!-- Copyright (c) 2001-2005 CrystalClear Software, Inc.
     Subject to the Boost Software License, Version 1.0. 
     (See accompanying file LICENSE_1_0.txt or  http://www.boost.org/LICENSE_1_0.txt)
-->

<section id="date_time.local_time"
  xmlns:xi="http://www.w3.org/2001/XInclude">
  <title>Local Time</title>
  <bridgehead renderas="sect2">Local Time System</bridgehead>
  <para>
    <link linkend="local_intro">Introduction</link> -- 
    <link linkend="local_ex">Usage Examples</link>
  </para>  
  
  <anchor id="local_intro" />
  <bridgehead renderas="sect3">Introduction</bridgehead>
  <para>
    The library supports 4 main extensions for the management of local times. This includes 
    <simplelist>
      <member>local_date_time -- locally adjusted time point</member>
      <member>posix_time_zone -- time zone defined by posix string (eg: "EST10EDT,M10.5.0,M3.5.0/03")</member>
      <member>time_zone_database -- get time zones by region from .csv file (eg: America/New York)</member>
      <member>time_zone -- abstract time zone interface</member>
    </simplelist>
  </para>
  <para>
    Together, these extensions define a time system adjusted for recording times related to a specific earth location. This time system utilizes all the features and benefits of the posix_time system (see <link linkend="date_time.posix_time">posix_time</link> for full details). It uses a time_zone object which contains all the necessary data/rules to enable adjustments to and from various time zones. The time_zone objects used in date_time are handled via a boost::shared_ptr&lt;boost::local_time::time_zone&gt;.
  </para>
  <para>
    The phrase "wall-clock" refers to the time that would be shown on a wall clock in a particular time zone at any point in time. Local_time uses a time zone object to account for differences in time zones and daylight savings adjustments. For example: While 5:00 pm, October 10, 2004 in Sydney Australia occurs at exactly the same instant as 3:00 am, October 10, 2004 in New York USA, it is a 14 hour difference in wall-clock times. However, a point in time just one day later will result in a 16 hour difference in wall-clock time due to daylight savings adjustments in both time zones. The local_time system tracks these by means of a time point, stored as UTC, and time_zone objects that contain all the necessary data to correctly calculate wall-clock times.
  </para>

  <anchor id="local_ex" />
  <bridgehead renderas="sect3">Usage Examples</bridgehead>
  <para>
    <informaltable frame="all">
      <tgroup cols="2">
	<thead>
	  <row>
	    <entry>Example</entry>
	    <entry>Description</entry>
	  </row>
	</thead>
	<tbody>
	  <row>
            <entry><link linkend="date_time.examples.simple_time_zone">Simple Time Zone</link></entry>
            <entry>Side by side examples of Time Zone usage. Both <type>custom_time_zone</type> and <type>posix_time_zone</type> are shown.</entry>
          </row>
	  <row>
            <entry><link linkend="date_time.examples.calc_rules">Daylight Savings Calc Rules</link></entry>
            <entry>Simple example showing the creation of all five <type>dst_calc_rule</type> types.</entry>
          </row>
	  <row>
            <entry><link linkend="date_time.examples.seconds_since_epoch">Seconds Since Epoch</link></entry>
            <entry>Example that calculates the total seconds elapsed since the epoch (1970-Jan-01) utilizing local_date_time.</entry>
          </row>
	</tbody>
      </tgroup>
    </informaltable>
  </para>

  <!-- this order chosen on 2005-Jan-30 -->
  <xi:include href="time_zone_base.xml" />
  <xi:include href="posix_time_zone.xml" />
  <xi:include href="tz_database.xml" />
  <xi:include href="custom_time_zone.xml" />
  <xi:include href="local_date_time.xml" />
  <xi:include href="local_time_period.xml" />
  <!--<xi:include href=".xml" /> for serialization -->
  <!-- includes here -->
  
</section>