<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage 2.0">
<title>Class DT_DATE_DURATION</title>
</head>

<body bgcolor="#FFFFFF">

<table border="0" width="100%">
    <tr>
        <td><font size="6"><strong>Class DT_DATE_DURATION</strong></font></td>
        <td align="right"><a href="dt_date.html"><img
        src="../../image/previous.gif" alt="Previous" border="0"
        width="40" height="40"></a><a href="dt_date_handler.html"><img
        src="../../image/next.gif" alt="Next" border="0"
        width="40" height="40"></a></td>
    </tr>
</table>

<hr size="1">

<pre><font color="#000080"><em><strong>note</strong></em></font></pre>

<blockquote>
    <pre><em>description</em>:

<font color="#800000"><em>    &quot;Date durations (Gregorian calendar)&quot;

</em></font><em>library:    </em><font color="#800000"><em>&quot;Gobo Eiffel Time Library&quot;
</em></font><em>author:     </em><font color="#800000"><em>&quot;Eric Bezault &lt;</em></font><a
href="mailto:ericb@gobosoft.com"><font color="#800000"><em>ericb@gobosoft.com</em></font></a><font
color="#800000"><em>&gt;&quot;
</em></font><em>copyright:  </em><font color="#800000"><em>&quot;Copyright (c) 2000-2001, Eric Bezault and others&quot;
</em></font><em>license:   </em><font color="#800000"><em> &quot;MIT License&quot;</em></font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>class interface</strong></em></font></pre>

<blockquote>
    <pre><em>DT_DATE_DURATION</em></pre>
</blockquote>

<pre><font color="#000080"><em><strong>inherit</strong></em></font></pre>

<blockquote>
    <pre><a href="dt_duration.html"><em>DT_DURATION</em></a><em>
    KL_PART_COMPARABLE
    </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/hashable.html"><em>HASHABLE</em></a><em>
    KL_CLONABLE
</em><a href="dt_date_value.html"><em>DT_DATE_VALUE</em></a><em>
</em><a href="dt_gregorian_calendar.html"><em>DT_GREGORIAN_CALENDAR</em></a></pre>
</blockquote>

<pre><font color="#000080"><em><strong>create</strong></em></font></pre>

<blockquote>
    <pre><a name="make"><em>make</em></a><em> </em>(<em>y</em>,<em> m</em>,<em> d</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Create a new date duration.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        year_set</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> y
        month_set</em>:<em> </em><a href="#month"><em>month</em></a><em> </em>=<em> m
        day_set</em>: <a href="#day"><em>day</em></a><em> </em>=<em> d</em></pre>
    <pre><a name="make_definite"><em>make_definite</em></a><em> </em>(<em>d</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Create a new definite date duration.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        is_definite</em>:<em> </em><a href="#is_definite"><em>is_definite</em></a><em>
        day_set</em>: <a href="#day"><em>day</em></a><em> </em>=<em> d</em></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Access</font></pre>

<blockquote>
    <pre><a name="year"><em>year</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Year</font>
<em>        </em><font color="#008000">-- (From </font><a
href="dt_date_value.html#year"><font color="#008000"><em>DT_DATE_VALUE</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="month"><em>month</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Month
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_date_value.html#month"><font color="#008000"><em>DT_DATE_VALUE</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="day"><em>day</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Day
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_date_value.html#day"><font color="#008000"><em>DT_DATE_VALUE</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="date"><em>date</em></a><em> </em>(<em>a_date</em>:<em> </em><a
href="dt_date.html"><em>DT_DATE</em></a>): <a href="dt_date.html"><em>DT_DATE</em></a><em>
</em><font color="#008000">        -- Addition of current duration to </font><em>a_date</em><font
color="#008000">
        -- (Create a new object at each call.)</font><em>
</em><font color="#008000">        -- (From </font><a
href="dt_duration.html#absolute_time"><font color="#008000"><em>absolute_time</em></font></a><font
color="#008000"> in </font><a
href="dt_duration.html#absolute_time"><font color="#008000"><em>DT_DURATION</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_date_not_void</em>:<em> a_date </em>/= <font
color="#008080"><em>Void</em></font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        date_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/=<em> </em><font
color="#008080"><em>Void</em></font><em>
        definition</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date.html#is_equal"><em>is_equal</em></a><em> </em>(<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>)</pre>
    <pre><a name="hash_code"><em>hash_code</em></a>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>
        <font color="#008000">-- Hash code value</font>
<em>        </em><font color="#008000">-- (From </font><a
href="http://www.gobosoft.com/eiffel/nice/elks95/hashable.html#hash_code"><font
color="#008000"><em>HASHABLE</em></font></a><font color="#008000">.)</font><font
color="#000080">
    <em><strong>ensure</strong></em></font>
        <em>good_hash_value</em>: <font color="#008080"><em>Result</em></font> &gt;= <font
color="#808000"><em>0</em></font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Status report</font></pre>

<blockquote>
    <pre><a name="is_definite"><em>is_definite</em></a>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000">        -- Is current duration independant of the date
        -- on which it applies (use of </font><a href="#day"><em>day</em></a><font
color="#008000"> only)
        -- or not (use of </font><a href="#year"><em>year</em></a><font
color="#008000">, </font><a href="#month"><em>month</em></a><font
color="#008000"> and </font><a href="#day"><em>day</em></a><font
color="#008000">)?</font><em>
</em><font color="#000080">    <em><strong>ensure</strong></em></font><em>
        definition</em>: <font color="#008080"><em>Result</em></font><em> </em>= (<a
href="#year"><em>year</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font><em> </em><font color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font>)</pre>
    <pre><a name="is_canonical"><em>is_canonical</em></a><em> </em>(<em>a_date</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#date"><em>date</em></a>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000">        -- Has current duration a canonical form
        -- when to be added to </font><em>a_date</em><font
color="#008000">?</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_date_not_void</em>:<em> a_date </em>/= <font
color="#008080"><em>Void</em></font><em>
</em><font color="#000080">    <em><strong>ensure</strong></em></font><em>
        positive_definition</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>((<em>a_date </em><a
href="dt_date.html#le">&lt;=</a><em> a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em>
            </em>(<a href="#year"><em>year</em></a><em> </em>&gt;=<em> </em><font
color="#808000"><em>0</em></font><em> </em><font color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>&gt;=<em> </em><font
color="#808000"><em>0</em></font><em> </em><font color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>&lt;<em> </em><a
href="#Months_in_year"><em>Months_in_year</em></a><em> </em><font
color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#day"><em>day</em></a> &gt;=<em> </em><font color="#808000"><em>0</em></font><em> </em><font
color="#000080"><em><strong>and</strong></em></font><em>
            </em>((<a href="#day"><em>day</em></a><em> </em>&gt;= (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#day"><em>day</em></a><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em>
                </em><a href="#day"><em>day</em></a><em> </em>&lt; (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#days_in_previous_month"><em>days_in_previous_month</em></a>)<em> </em><font
color="#000080"><em><strong>or</strong></em></font><em>
            </em>(<a href="#day"><em>day</em></a><em> </em>&lt; (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#day"><em>day</em></a><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em>
                </em><a href="#day"><em>day</em></a><em> </em>&lt; (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#days_in_current_month"><em>days_in_current_month</em></a>))))<em>
        negative_definition</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>((<em>a_date </em><a
href="dt_date.html#ge">&gt;=</a><em> a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em>
            </em>(<a href="#year"><em>year</em></a><em> </em>&lt;=<em> </em><font
color="#808000"><em>0</em></font><em> </em><font color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>&lt;=<em> </em><font
color="#808000"><em>0</em></font><em> </em><font color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>&gt; -<a
href="#Months_in_year"><em>Months_in_year</em></a><em> </em><font
color="#000080"><em><strong>and</strong></em></font><em>
            </em><a href="#day"><em>day</em></a><em> </em>&lt;=<em> </em><font
color="#808000"><em>0</em></font><em> </em><font color="#000080"><em><strong>and</strong></em></font><em> </em><a
href="#day"><em>day</em></a><em> </em>&gt; -(<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#days_in_current_month"><em>days_in_current_month</em></a>))</pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Status setting</font></pre>

<blockquote>
    <pre><a name="set_definite"><em>set_definite</em></a><em> </em>(<em>a_date</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#date"><em>date</em></a>)<em>
</em><font color="#008000">        -- Set current duration to be definite
        -- when to be added to </font><em>a_date</em><font
color="#008000">.</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_date_not_void</em>:<em> a_date </em>/= <font
color="#008080"><em>Void</em></font><em>
</em><font color="#000080">    <em><strong>ensure</strong></em></font><em>
        is_definite</em>:<em> </em><a href="#is_definite"><em>is_definite</em></a><em>
        same_duration</em>: (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#is_equal"><em>is_equal</em></a><em> </em>(<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> cloned_object</em>)</pre>
    <pre><a name="set_canonical"><em>set_canonical</em></a><em> </em>(<em>a_date</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#date"><em>date</em></a>)<em>
</em><font color="#008000">        -- Set current duration to be canonical
        -- when to be added to </font><em>a_date</em><font
color="#008000">.</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_date_not_void</em>:<em> a_date </em>/= <font
color="#008080"><em>Void</em></font><em>
</em><font color="#000080">    <em><strong>ensure</strong></em></font><em>
        is_canonical</em>:<em> </em><a href="#is_canonical"><em>is_canonical</em></a><em> </em>(<em>a_date</em>)<em>
        same_duration</em>: (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#is_equal"><em>is_equal</em></a><em> </em>(<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> cloned_object</em>)</pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Setting</font></pre>

<blockquote>
    <pre><a name="set_year_month_day"><em>set_year_month_day</em></a><em> </em>(<em>y</em>,<em> m</em>,<em> d</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Set </font><a href="#year"><em>year</em></a><font
color="#008000"> to </font><em>y</em><font color="#008000">, </font><a
href="#month"><em>month</em></a><font color="#008000"> to </font><em>m</em><font
color="#008000"> and </font><a href="#day"><em>day</em></a><font
color="#008000"> to </font><em>d</em><font color="#008000">.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        year_set</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> y
        month_set</em>:<em> </em><a href="#month"><em>month</em></a><em> </em>=<em> m
        day_set</em>: <a href="#day"><em>day</em></a><em> </em>=<em> d</em></pre>
    <pre><a name="set_year"><em>set_year</em></a><em> </em>(<em>y</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Set </font><a href="#year"><em>year</em></a><font
color="#008000"> to </font><em>y</em><font color="#008000">.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        year_set</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> y
        same_month</em>:<em> </em><a href="#month"><em>month</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em>
        same_day</em>:<em> </em><a href="#day"><em>day</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#day"><em>day</em></a></pre>
    <pre><a name="set_month"><em>set_month</em></a><em> </em>(<em>m</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Set </font><a href="#month"><em>month</em></a><font
color="#008000"> to </font><em>m</em><font color="#008000">.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        month_set</em>:<em> </em><a href="#month"><em>month</em></a><em> </em>= <em>m
        same_year</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#year"><em>year</em></a><em>
        same_day</em>:<em> </em><a href="#day"><em>day</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#day"><em>day</em></a></pre>
    <pre><a name="set_day"><em>set_day</em></a><em> </em>(<em>d</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Set </font><a href="#day"><em>day</em></a><font
color="#008000"> to </font><em>d</em><font color="#008000">.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        day_set</em>:<em> </em><a href="#day"><em>day</em></a><em> </em>=<em> d
        same_year</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#year"><em>year</em></a><em>
        same_month</em>: <a href="#month"><em>month</em></a><em> </em>= <font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#month"><em>month</em></a></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Element change</font></pre>

<blockquote>
    <pre><a name="add_years_months_days"><em>add_years_months_days</em></a><em> </em>(<em>y</em>,<em> m</em>,<em> d</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Add </font><em>y</em><font
color="#008000"> years, </font><em>m</em><font color="#008000"> months and</font><em> d</em><font
color="#008000"> days to current duration.
</font><em>    </em><font color="#000080"><em><strong>ensure</strong></em></font><font
color="#008000">
</font><em>        years_added</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#year"><em>year</em></a><em> </em>+<em> y
        months_added</em>:<em> </em><a href="#month"><em>month</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>+<em> m
        days_added</em>:<em> </em><a href="#day"><em>day</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#day"><em>day</em></a><em> </em>+<em> d</em></pre>
    <pre><a name="add_years"><em>add_years</em></a><em> </em>(<em>y</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Add </font><em>y</em><font
color="#008000"> years to current duration.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        years_added</em>:<em> </em><a href="#year"><em>year</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#year"><em>year</em></a><em> </em>+<em> y
</em></pre>
    <pre><a name="add_months"><em>add_months</em></a><em> </em>(<em>m</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Add </font><em>m</em><font
color="#008000"> months to current duration.</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        months_added</em>:<em> </em><a href="#month"><em>month</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#month"><em>month</em></a><em> </em>+<em> m</em></pre>
    <pre><a name="add_days"><em>add_days</em></a><em> </em>(<em>d</em>: <a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>)<em>
</em><font color="#008000">        -- Add </font><em>d</em><font
color="#008000"> days to current duration.
</font><em>    </em><font color="#000080"><em><strong>ensure
</strong></em></font><em>        days_added</em>:<em> </em><a
href="#day"><em>day</em></a><em> </em>=<em> </em><font
color="#000080"><em><strong>old</strong></em></font><em> </em><a
href="#day"><em>day</em></a><em> </em>+<em> d</em></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Basic operations</font></pre>

<blockquote>
    <pre><a name="infix_plus"><font color="#000080"><em><strong>infix</strong></em></font><em> </em><font
color="#800000"><em>&quot;+&quot;</em></font></a><em> </em>(<em>other</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font>):<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>
</em><font color="#008000">        -- Sum of current duration with </font><em>other
        </em><font color="#008000">-- (From </font><a
href="dt_duration.html#infix_plus"><font color="#008000"><em>DT_DURATION</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        other_not_void</em>:<em> other </em>/= <font
color="#008080"><em>Void</em></font><font color="#000080">
    <em><strong>ensure</strong></em></font><em>
        addition_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/=<em> </em><font
color="#008080"><em>Void</em></font></pre>
    <pre><a name="infix_minus"><font color="#000080"><em><strong>infix</strong></em></font><em> </em><font
color="#800000"><em>&quot;-&quot;</em></font></a><em> </em>(<em>other</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font>):<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>
</em><font color="#008000">        -- Difference with </font><em>other
        </em><font color="#008000">-- (From </font><a
href="dt_duration.html#infix_minus"><font color="#008000"><em>DT_DURATION</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        other_not_void</em>:<em> other </em>/= <font
color="#008080"><em>Void</em></font><font color="#000080">
    <em><strong>ensure</strong></em></font><em>
        subtraction_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/=<em> </em><font
color="#008080"><em>Void</em></font></pre>
    <pre><a name="prefix_plus"><font color="#000080"><em><strong>prefix</strong></em></font><em> </em><font
color="#800000"><em>&quot;+&quot;</em></font></a>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>
</em><font color="#008000">        -- Unary plus</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_duration.html#prefix_plus"><font color="#008000"><em>DT_DURATION</em></font></a><font
color="#008000">.)</font><em>
</em><font color="#000080">    <em><strong>ensure</strong></em></font><em>
        unary_plus_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/=<em> </em><font
color="#008080"><em>Void</em></font><em>
        same_object</em>:<em> </em><font color="#008080"><em>Result </em></font><em>= </em><font
color="#008080"><em>Current</em></font></pre>
    <pre><a name="prefix_minus"><font color="#000080"><em><strong>prefix</strong></em></font><em> </em><font
color="#800000"><em>&quot;-&quot;</em></font></a>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>
</em><font color="#008000">        -- Unary minus</font><font
color="#000080">
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_duration.html#prefix_minus"><font color="#008000"><em>DT_DURATION</em></font></a><font
color="#008000">.)</font><font color="#000080">
    <em><strong>ensure</strong></em></font><em>
        unary_minus_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/=<em> </em><font
color="#008080"><em>Void</em></font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature</strong></em></font> <font
color="#008000">-- Comparison</font></pre>

<blockquote>
    <pre><a name="lt"><font color="#000080"><em><strong>infix</strong></em></font> <font
color="#800000"><em>&quot;&lt;&quot;</em></font></a> (<em>other</em>: <font
color="#000080"><em><strong>like</strong></em></font> <font
color="#008080"><em>Current</em></font>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a>
        <font color="#008000">-- Is current date duration less than </font><em>other</em><font
color="#008000">?</font>
<em>        </em><font color="#008000">-- (From <em>KL_PART_COMPARABLE</em>.)</font>
    <font color="#000080"><em><strong>require</strong></em></font>
        <em>other_not_void</em>: <em>other</em> /= <font
color="#008080"><em>Void</em></font></pre>
</blockquote>

<blockquote>
    <pre><a name="lt"><font color="#000080"><em><strong>infix</strong></em></font></a><a
name="le"> <font color="#800000"><em>&quot;&lt;=&quot;</em></font></a> (<em>other</em>: <font
color="#000080"><em><strong>like</strong></em></font> <font
color="#008080"><em>Current</em></font>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a>
        <font color="#008000">-- Is current object less than or equal to </font><em>other</em><font
color="#008000">?</font>
<em>        </em><font color="#008000">-- (From <em>KL_PART_COMPARABLE</em>.)</font>
    <font color="#000080"><em><strong>require</strong></em></font>
        <em>other_not_void</em>: <em>other</em> /= <font
color="#008080"><em>Void</em></font>
    <font color="#000080"><em><strong>ensure</strong></em></font>
        <em>definition</em>: <font color="#008080"><em>Result</em></font> = ((<font
color="#008080"><em>Current</em></font> <a href="#lt">&lt;</a> <em>other</em>) <font
color="#000080"><em><strong>or</strong></em></font> <a
href="#is_equal"><em>is_equal</em></a> (<em>other</em>))</pre>
</blockquote>

<blockquote>
    <pre><a name="lt"><font color="#000080"><em><strong>infix</strong></em></font></a><a
name="ge"> <font color="#800000"><em>&quot;&gt;=&quot;</em></font></a> (<em>other</em>: <font
color="#000080"><em><strong>like</strong></em></font> <font
color="#008080"><em>Current</em></font>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a>
        <font color="#008000">-- Is current object greater than or equal to </font><em>other</em><font
color="#008000">?</font>
<em>        </em><font color="#008000">-- (From <em>KL_PART_COMPARABLE</em>.)</font>
    <font color="#000080"><em><strong>require</strong></em></font>
        <em>other_not_void</em>: <em>other</em> /= <font
color="#008080"><em>Void</em></font>
    <font color="#000080"><em><strong>ensure</strong></em></font>
        <em>definition</em>: <font color="#008080"><em>Result</em></font> = (<em>other</em> <a
href="#le">&lt;=</a> <font color="#008080"><em>Current</em></font>)</pre>
</blockquote>

<blockquote>
    <pre><a name="lt"><font color="#000080"><em><strong>infix</strong></em></font></a><a
name="gt"> <font color="#800000"><em>&quot;&gt;&quot;</em></font></a> (<em>other</em>: <font
color="#000080"><em><strong>like</strong></em></font> <font
color="#008080"><em>Current</em></font>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a>
        <font color="#008000">-- Is current object greater than </font><em>other</em><font
color="#008000">?</font>
<em>        </em><font color="#008000">-- (From <em>KL_PART_COMPARABLE</em>.)</font>
    <font color="#000080"><em><strong>require</strong></em></font>
        <em>other_not_void</em>: <em>other</em> /= <font
color="#008080"><em>Void</em></font>
    <font color="#000080"><em><strong>ensure</strong></em></font>
        <em>definition</em>: <font color="#008080"><em>Result</em></font> = ((<em>other</em> &lt; <font
color="#008080"><em>Current</em></font>) <font color="#000080"><em><strong>or</strong></em></font> <a
href="#is_equal"><em>is_equal</em></a> (<em>other</em>))</pre>
</blockquote>

<blockquote>
    <pre><a name="is_equal"><em>is_equal</em></a> (<em>other</em>: <font
color="#000080"><em><strong>like</strong></em></font> <font
color="#008080"><em>Current</em></font>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a>
        <font color="#008000">-- Is current date duration equal to </font><em>other</em><font
color="#008000">?
</font><em>        </em><font color="#008000">-- (From </font><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#is_equal"><font
color="#008000"><em>GENERAL</em></font></a><font color="#008000">.)</font>
    <font color="#000080"><em><strong>require</strong></em></font><em>
        other_not_void</em>: <em>other</em> /= <font
color="#008080"><em>Void</em></font>
    <font color="#000080"><em><strong>ensure</strong></em></font>
        <em>symmetric</em>: <font color="#008080"><em>Result</em></font> <font
color="#000080"><em><strong>implies</strong></em></font> <em>other</em>.<a
href="#is_equal"><em>is_equal</em></a> (<font color="#008080"><em>Current</em></font>)
        <em>consistent</em>: <a
href="../../../../../www/eiffel/nice/elks95/general.html#standard_is_equal"><em>standard_is_equal</em></a> (<em>other</em>) <font
color="#000080"><em><strong>implies</strong></em></font> <font
color="#008080"><em>Result</em></font></pre>
    <pre><a name="same_date_duration"><em>same_date_duration</em></a><em> </em>(<em>other</em>:<em> </em><a
href="dt_date_duration.html"><em>DT_DATE_DURATION</em></a>): <a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em>        <font color="#008000">-- Is current date duration equal to </font><em>other</em><font
color="#008000">?</font><em>
</em>    <font color="#000080"><em><strong>require</strong></em></font><em>
        other_not_void</em>: <em>other</em> /= <font
color="#008080"><em>Void</em></font><em>
</em>    <font color="#000080"><em><strong>ensure</strong></em></font><em>
        definition</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>= ((<a
href="#day"><em>day</em></a><em> </em>=<em> other</em>.<a
href="dt_date_duration.html#day"><em>day</em></a>)<em> </em><font
color="#000080"><em><strong>and</strong></em></font><em>
            </em>((<a href="#year"><em>year</em></a><em> </em>*<em> </em><a
href="#Months_in_year"><em>Months_in_year</em></a><em> </em>+<em> </em><a
href="#month"><em>month</em></a>) =<em>
                </em>(<em>other</em>.<a
href="dt_date_duration.html#year"><em>year</em></a><em> </em>*<em> </em><a
href="#Months_in_year"><em>Months_in_year</em></a><em> </em>+ <em>other</em>.<a
href="dt_date_duration.html#month"><em>month</em></a>)))</pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature</strong></em></font> <font
color="#008000">-- Duplication</font></pre>

<blockquote>
    <pre><a name="copy"><em>copy</em></a><em> </em>(<em>other</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font>)<em>
        </em><font color="#008000">-- Copy </font><em>other</em><font
color="#008000"> to current duration.
        -- (From </font><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#copy"><font
color="#008000"><em>GENERAL</em></font></a><font color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        other_not_void</em>:<em> other </em>/= <font
color="#008080"><em>Void</em></font><em>
        type_identity</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#same_type"><em>same_type</em></a><em> </em>(<em>other</em>)<em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        is_equal</em>:<em> </em><a href="#is_equal"><em>is_equal</em></a><em> </em>(<em>other</em>)</pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature</strong></em></font> <font
color="#008000">-- Conversion</font></pre>

<blockquote>
    <pre><a name="to_date_time_duration"><em>to_date_time_duration</em></a>:<em> </em><a
href="dt_date_time_duration.html"><em>DT_DATE_TIME_DURATION</em></a><em>
</em><font color="#008000">        -- Date time duration equivalent to current date duration</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        date_time_duration_not_void</em>:<em> </em><font
color="#008080"><em>Result</em></font><em> </em>/= <font
color="#008080"><em>Void</em></font><em>
        year_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#year"><em>year</em></a><em> </em>=<em> </em><a
href="#year"><em>year</em></a><em>
        month_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#month"><em>month</em></a><em> </em>=<em> </em><a
href="#month"><em>month</em></a><em>
        day_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#day"><em>day</em></a><em> </em>=<em> </em><a
href="#day"><em>day</em></a><em>
        hour_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#hour"><em>hour</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font><em>
        minute_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#minute"><em>minute</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font><em>
        second_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#second"><em>second</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font><em>
        millisecond_set</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="dt_date_time_duration.html#millisecond"><em>millisecond</em></a><em> </em>=<em> </em><font
color="#808000"><em>0</em></font></pre>
    <pre><a name="to_canonical"><em>to_canonical</em></a><em> </em>(<em>a_date</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#date"><em>date</em></a>):<em> </em><font color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>
</em><font color="#008000">        -- Canonical version of current duration
        -- when to be added to </font><em>a_date
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_date_not_void</em>:<em> a_date </em>/= <font
color="#008080"><em>Void</em></font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        canonical_duration_not_void</em>:<em> </em><font
color="#008080"><em>Result</em></font><em> </em>/= <font
color="#008080"><em>Void</em></font><em>
        is_canonical</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="#is_canonical"><em>is_canonical</em></a><em> </em>(<em>a_date</em>)<em>
        same_duration</em>: (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#is_equal"><em>is_equal</em></a><em> </em>(<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Result</em></font>)</pre>
    <pre><a name="to_definite"><em>to_definite</em></a><em> </em>(<em>a_date</em>:<em> </em><font
color="#000080"><em><strong>like</strong></em></font><em> </em><a
href="#date"><em>date</em></a>):<em> </em><font color="#000080"><em><strong>like</strong></em></font><em> </em><font
color="#008080"><em>Current</em></font><em>
</em><font color="#008000">        -- Definite version of current duration
        -- when to be added to </font><em>a_date
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_date_not_void</em>:<em> a_date </em>/= <font
color="#008080"><em>Void</em></font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        definite_duration_not_void</em>:<em> </em><font
color="#008080"><em>Result</em></font><em> </em>/= <font
color="#008080"><em>Void</em></font><em>
        is_definite</em>:<em> </em><font color="#008080"><em>Result</em></font>.<a
href="#is_definite"><em>is_definite</em></a><em>
        same_duration</em>: (<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Current</em></font>).<a
href="dt_date.html#is_equal"><em>is_equal</em></a><em> </em>(<em>a_date </em><a
href="dt_date.html#infix_plus">+</a><em> </em><font
color="#008080"><em>Result</em></font>)</pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature</strong></em></font> <font
color="#008000">-- Output</font></pre>

<blockquote>
    <pre><a name="out"><em>out</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/string.html"><em>STRING</em></a><em>
</em><font color="#008000">        -- Printable representation (year/month/day)</font><em>
</em><font color="#008000">        -- (From </font><a
href="http://www.gobosoft.com/eiffel/nice/elks95/general.html#out"><font
color="#008000"><em>GENERAL</em></font></a><font color="#008000">.)</font><em>
</em><em><strong>    </strong></em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        out_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/= <font
color="#008080"><em>Void</em></font></pre>
    <pre><a name="date_out"><em>date_out</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/string.html"><em>STRING</em></a><em>
</em><font color="#008000">        -- Printable representation (year/month/day)</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_date_value.html#date_out"><font color="#008000"><em>DT_DATE_VALUE</em></font></a><font
color="#008000">.)</font><em>
</em><em><strong>    </strong></em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        date_out_not_void</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>/= <font
color="#008080"><em>Void</em></font></pre>
    <pre><a name="append_to_string"><em>append_to_string</em></a><em> </em>(<em>a_string</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/string.html"><em>STRING</em></a>)<em>
</em><font color="#008000">        -- Append printable representation
        -- (year/month/day) to </font><em>a_string</em><font
color="#008000">.</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_date_value.html#append_to_string"><font color="#008000"><em>DT_DATE_VALUE</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_string_not_void</em>:<em> a_string </em>/= <font
color="#008080"><em>Void</em></font></pre>
    <pre><a name="append_date_to_string"><em>append_date_to_string</em></a><em> </em>(<em>a_string</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/string.html"><em>STRING</em></a>)<em>
</em><font color="#008000">        -- Append printable representation
        -- (year/month/day) to </font><em>a_string</em><font
color="#008000">.</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_date_value.html#append_date_to_string"><font
color="#008000"><em>DT_DATE_VALUE</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        a_string_not_void</em>:<em> a_string </em>/= <font
color="#008080"><em>Void</em></font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Year</font></pre>

<blockquote>
    <pre><a name="leap_year"><em>leap_year</em></a><em> </em>(<em>y</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/boolean.html"><em>BOOLEAN</em></a><em>
</em><font color="#008000">        -- Is </font><em>y</em><font
color="#008000"> a leap year?
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#leap_year"><font color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Months_in_year"><em>Months_in_year</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of months in a year</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Months_in_year"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        definition</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>= (<a
href="#December"><em>December</em></a><em> </em>-<em> </em><a
href="#Januray"><em>Januray</em></a><em> </em>+<em> </em><font
color="#808000"><em>1</em></font>)</pre>
    <pre><a name="Days_in_year"><em>Days_in_year</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_leap_year"><em>Days_in_leap_year</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of days in a (leap) year
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Days_in_year"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Days_in_400_years"><em>Days_in_400_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_100_years"><em>Days_in_100_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_4_years"><em>Days_in_4_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_3_years"><em>Days_in_3_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_3_leap_years"><em>Days_in_3_leap_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_2_years"><em>Days_in_2_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Days_in_2_leap_years"><em>Days_in_2_leap_years</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of days in multiple years
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Days_in_400_years"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Month</font></pre>

<blockquote>
    <pre><a name="January"><em>January</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="February"><em>February</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="March"><em>March</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="April"><em>April</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="May"><em>May</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="June"><em>June</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="July"><em>July</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="August"><em>August</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="September"><em>September</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="October"><em>October</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="November"><em>November</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="December"><em>December</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Months
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#January"><font color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="days_in_month"><em>days_in_month</em></a><em> </em>(<em>m</em>,<em> y</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of days in month </font><em>m</em><font
color="#008000"> of year </font><em>y
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#days_in_month"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        m_large_enough</em>:<em> m </em>&gt;=<em> </em><a
href="#January"><em>January</em></a><em>
        m_small_enough</em>:<em> m </em>&lt;=<em> </em><a
href="#December"><em>December</em></a><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        at_least_one</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>&gt;=<em> </em><font
color="#808000"><em>1</em></font><em>
        max_days_in_month</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>&lt;=<em> </em><a
href="#Max_days_in_month"><em>Max_days_in_month</em></a></pre>
    <pre><a name="Max_days_in_month"><em>Max_days_in_month</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Maximum number of days in a month
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Max_days_in_month"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="days_at_month"><em>days_at_month</em></a><em> </em>(<em>m</em>,<em> y</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of days from beginning of year
        -- </font><em>y</em><font color="#008000"> until beginning of month </font><em>m
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#days_at_month"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        m_large_enough</em>:<em> m </em>&gt;=<em> </em><a
href="#January"><em>January</em></a><em>
        m_small_enough</em>:<em> m </em>&lt;=<em> </em><a
href="#December"><em>December</em></a><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        days_positive</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>&gt;=<em> </em><font
color="#808000"><em>0</em></font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Week day</font></pre>

<blockquote>
    <pre><a name="Sunday"><em>Sunday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Monday"><em>Monday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Tuesday"><em>Tuesday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Wednesday"><em>Wednesday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Thursday"><em>Thursday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Friday"><em>Friday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Saturday"><em>Saturday</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Week days
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Sunday"><font color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Days_in_week"><em>Days_in_week</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of days in a week</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Days_in_week"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        definition</em>:<em> </em><font color="#008080"><em>Result</em></font><em> </em>= (<a
href="#Saturday"><em>Saturday</em></a><em> </em>- <a
href="#Sunday"><em>Sunday</em></a><em> </em>+<em> </em><font
color="#808000"><em>1</em></font>)</pre>
    <pre><a name="next_day"><em>next_day</em></a><em> </em>(<em>d</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Week day after </font><em>d
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#next_day"><font color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        d_large_enough</em>:<em> d </em>&gt;=<em> </em><a
href="#Sunday"><em>Sunday</em></a><em>
        d_small_enough</em>:<em> d </em>&lt;=<em> </em><a
href="#Saturday"><em>Saturday</em></a><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        sunday_definition</em>: (<em>d </em>=<em> </em><a
href="#Sunday"><em>Sunday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Monday"><em>Monday</em></a>)<em>
        monday_definition</em>: (<em>d </em>=<em> </em><a
href="#Monday"><em>Monday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Tuesday"><em>Tuesday</em></a>)<em>
        tuesday_definition</em>: (<em>d </em>=<em> </em><a
href="#Tuesday"><em>Tuesday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Wednesday"><em>Wednesday</em></a>)<em>
        wednesday_definition</em>: (<em>d </em>=<em> </em><a
href="#Wednesday"><em>Wednesday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Thursday"><em>Thursday</em></a>)<em>
        thursday_definition</em>: (<em>d </em>=<em> </em><a
href="#Thursday"><em>Thursday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font>=<em> </em><a
href="#Friday"><em>Friday</em></a>)<em>
        friday_definition</em>: (<em>d </em>=<em> </em><a
href="#Friday"><em>Friday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Saturday"><em>Saturday</em></a>)<em>
        saturday_definition</em>: (<em>d </em>=<em> </em><a
href="#Saturday"><em>Saturday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Sunday"><em>Sunday</em></a>)</pre>
    <pre><a name="previous_day"><em>previous_day</em></a><em> </em>(<em>d</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Week day before </font><em>d
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#previous_day"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        d_large_enough</em>:<em> d </em>&gt;=<em> </em><a
href="#Sunday"><em>Sunday</em></a><em>
        d_small_enough</em>:<em> d </em>&lt;=<em> </em><a
href="#Saturday"><em>Saturday</em></a><em>
    </em><font color="#000080"><em><strong>ensure</strong></em></font><em>
        sunday_definition</em>: (<em>d </em>=<em> </em><a
href="#Sunday"><em>Sunday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Saturday"><em>Saturday</em></a><em>)
        monday_definition</em>: (<em>d </em>=<em> </em><a
href="#Monday"><em>Monday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Sunday"><em>Sunday</em></a><em>)
        tuesday_definition</em>: (<em>d </em>=<em> </em><a
href="#Tuesday"><em>Tuesday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Monday"><em>Monday</em></a><em>)
        wednesday_definition</em>: (<em>d </em>=<em> </em><a
href="#Wednesday"><em>Wednesday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Tuesday"><em>Tuesday</em></a><em>)
        thursday_definition</em>: (<em>d </em>=<em> </em><a
href="#Thursday"><em>Thursday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font>=<em> </em><a
href="#Wednesday"><em>Wednesday</em></a><em>)
        friday_definition</em>: (<em>d </em>=<em> </em><a
href="#Friday"><em>Friday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Thursday"><em>Thursday</em></a><em>)
        saturday_definition</em>: (<em>d </em>=<em> </em><a
href="#Saturday"><em>Saturday</em></a>)<em> </em><font
color="#000080"><em><strong>implies</strong></em></font><em> </em>(<font
color="#008080"><em>Result</em></font><em> </em>=<em> </em><a
href="#Friday"><em>Friday</em></a><em>)</em></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Time</font></pre>

<blockquote>
    <pre><a name="Seconds_in_minute"><em>Seconds_in_minute</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of seconds in a minute
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Seconds_in_minute"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Seconds_in_hour"><em>Seconds_in_hour</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of seconds in an hour
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Seconds_in_hour"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Seconds_in_day"><em>Seconds_in_day</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of seconds in a day
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Seconds_in_day"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Milliseconds_in_day"><em>Milliseconds_in_day</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of milliseconds in a day
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Milliseconds_in_day"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Minutes_in_hour"><em>Minutes_in_hour</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of minutes in an hour
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Minutes_in_hour"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="Hours_in_day"><em>Hours_in_day</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of hours in a day
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Hours_in_day"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
</blockquote>

<pre><font color="#000080"><em><strong>feature </strong></em></font><font
color="#008000">-- Epoch</font></pre>

<blockquote>
    <pre><a name="Epoch_year"><em>Epoch_year</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Epoch_month"><em>Epoch_month</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><a name="Epoch_day"><em>Epoch_day</em></a>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Epoch date (1 Jan 1970)
</font><em>        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#Epoch_year"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font></pre>
    <pre><a name="epoch_days"><em>epoch_days</em></a><em> </em>(<em>y</em>,<em> m</em>,<em> d</em>:<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a>):<em> </em><a
href="http://www.gobosoft.com/eiffel/nice/elks95/integer.html"><em>INTEGER</em></a><em>
</em><font color="#008000">        -- Number of days since epoch date (1 Jan 1970)</font><em>
        </em><font color="#008000">-- (From </font><a
href="dt_gregorian_calendar.html#epoch_days"><font
color="#008000"><em>DT_GREGORIAN_CALENDAR</em></font></a><font
color="#008000">.)</font><em>
    </em><font color="#000080"><em><strong>require</strong></em></font><em>
        m_large_enough</em>:<em> m </em>&gt;= <a href="#January"><em>January</em></a><em>
        m_small_enough</em>:<em> m </em>&lt;=<em> </em><a
href="#December"><em>December</em></a><em>
        d_large_enough</em>:<em> d </em>&gt;=<em> </em><font
color="#808000"><em>1</em></font><em>
        d_small_enough</em>:<em> d </em>&lt;=<em> </em><a
href="#days_in_month"><em>days_in_month</em></a><em> </em>(<em>m</em>,<em> y</em>)</pre>
</blockquote>

<pre><font color="#000080"><em><strong>end</strong></em></font><font
color="#008000"> -- class DT_DATE_DURATION</font></pre>

<hr size="1">

<table border="0" width="100%">
    <tr>
        <td><address>
            <font size="2"><b>Copyright © 2000-2001</b></font><font
            size="1"><b>, </b></font><font size="2"><strong>Eric
            Bezault</strong></font><strong> </strong><font
            size="2"><br>
            <strong>mailto:</strong></font><a
            href="mailto:ericb@gobosoft.com"><font size="2">ericb@gobosoft.com</font></a><font
            size="2"><br>
            <strong>http:</strong></font><a
            href="http://www.gobosoft.com"><font size="2">//www.gobosoft.com</font></a><font
            size="2"><br>
            <strong>Last Updated:</strong> 9 April 2001</font><br>
            <!--webbot bot="PurpleText"
            preview="
$Date$
$Revision$"
            -->
        </address>
        </td>
        <td align="right" valign="top"><a
        href="http://www.gobosoft.com"><img
        src="../../image/home.gif" alt="Home" border="0"
        width="40" height="40"></a><a href="index.html"><img
        src="../../image/toc.gif" alt="Toc" border="0" width="40"
        height="40"></a><a href="dt_date.html"><img
        src="../../image/previous.gif" alt="Previous" border="0"
        width="40" height="40"></a><a href="dt_date_handler.html"><img
        src="../../image/next.gif" alt="Next" border="0"
        width="40" height="40"></a></td>
    </tr>
</table>
</body>
</html>
