Files
date_time/doc/DateTimeConcepts-Calculations.html
Jeff Garland ff695fc565 add first version of docs
[SVN r14823]
2002-08-13 22:26:20 +00:00

101 lines
3.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Date-Time Concepts - Calculation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.10 -->
<body>
<a href="http://www.boost.org">
<img align="left" src="c++boost.gif" alt="C++ Boost">
</a>
<h1>Date Time Concepts - Calculation</h1>
<p>
<p>
<p>
<p>
<a href="index.html">GDTL Index</a> --
<a href="gregorian.html">Gregorian Index</a> --
<a href="posix_time.html">Posix Time Index</a>
<p>
<font class="bold">Date Time Concepts - Calculation</font>
<p>
<a href="DateTimeConcepts-Calculations.html#timepoints">Timepoints</a> --
<a href="DateTimeConcepts-Calculations.html#durations">Durations</a> --
<a href="DateTimeConcepts-Calculations.html#intervals">Interval</a> --
<a href="DateTimeConcepts-Calculations.html#special">Special Cases</a>
<p>
<a name="timepoints"><h2>Timepoints</h2></a>
<p>
This section describes some of basic arithmetic rules that can be performed with GDTL timepoints.
<PRE>
Timepoint + Duration --&gt; Timepoint
Timepoint - Duration --&gt; Timepoint
Duration + Timepoint --&gt; Undefined
Duration - Timepoint --&gt; Undefined
Timepoint + Timepoint --&gt; Undefined
Timepoint - Timepoint --&gt; Duration
</PRE>
<p>
<a name="durations"><h2>Durations</h2></a>
<p>
This section describes standard operations for a time duration.
<PRE>
Duration + Duration --&gt; Duration
Duration - Duration --&gt; Duration
Duration * Integer --&gt; Duration
Integer * Duration --&gt; Duration
Duration(&#8734;) * Integer --&gt; Duration(&#8734;)
Duration(&#8734;)/Integer --&gt; Duration(&#8734;)
</PRE>
<p>
<p>
<a name="intervals"><h2>Intervals</h2></a>
<p>
Here are the "operations" supported by intervals. They are based on half-open
range.
<PRE>
//These can be defined by either of 2 Timepoints or a Timepoint and Duration
Timeinterval intersects Timeinterval --&gt; bool
Timeinterval intersection Timeinterval --&gt; Timeperiod //results undefined if no intersection
Timeinterval contains Timepoint --&gt; bool
Timeinterval contains Timeinterval --&gt; bool
Timeinterval shift Duration --&gt; shift start and end by duration amount
</PRE>
<HR>
<p>
<a name="special"><h2>Special Cases</h2></a>
<P>In general special values such as Not A Date Time (NADT) and infinity should follow rules like floating point values. Note that it should be possible to
configure NADT based systems to throw an exception instead of result in NADT.
<PRE>
Timepoint(NADT) + Duration --&gt; Timepoint(NADT)
Timepoint(&#8734;) + Duration --&gt; Timepoint(&#8734;)
Timepoint + Duration(&infin;) --&gt; Timepoint(&#8734;)
Timepoint - Duration(&#8734;) --&gt; Timepoint(-&#8734;)
</PRE>
<hr>
<address><small>
<!-- hhmts start -->
Last modified: Mon Jul 8 14:26:05 MST 2002
<!-- hhmts end -->
by Jeff Garland for <a href="http://www.crystalclearsoftware.com">CrystalClear Software</a>&nbsp;&copy 2000-2002
</small></address>
</body>
</html>