Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 6233d9843498773eadbb27fa7ac1e51f > files > 31

ocaml-calendar-devel-2.01.1-5.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="Up" href="Date_sig.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Utils" rel="Chapter" href="Utils.html">
<link title="Time_Zone" rel="Chapter" href="Time_Zone.html">
<link title="Period" rel="Chapter" href="Period.html">
<link title="Time_sig" rel="Chapter" href="Time_sig.html">
<link title="Time" rel="Chapter" href="Time.html">
<link title="Ftime" rel="Chapter" href="Ftime.html">
<link title="Date_sig" rel="Chapter" href="Date_sig.html">
<link title="Date" rel="Chapter" href="Date.html">
<link title="Calendar_sig" rel="Chapter" href="Calendar_sig.html">
<link title="Calendar_builder" rel="Chapter" href="Calendar_builder.html">
<link title="Calendar" rel="Chapter" href="Calendar.html">
<link title="Fcalendar" rel="Chapter" href="Fcalendar.html">
<link title="Printer" rel="Chapter" href="Printer.html">
<link title="Version" rel="Chapter" href="Version.html"><link title="Datatypes" rel="Section" href="#2_Datatypes">
<link title="Exceptions" rel="Section" href="#2_Exceptions">
<link title="Constructors" rel="Section" href="#2_Constructors">
<link title="Getters" rel="Section" href="#2_Getters">
<link title="Dates are comparable" rel="Section" href="#2_Datesarecomparable">
<link title="Boolean operations on dates" rel="Section" href="#2_Booleanoperationsondates">
<link title="Coercions" rel="Section" href="#2_Coercions">
<link title="Period" rel="Section" href="#2_Period">
<link title="Arithmetic operations on dates and periods" rel="Section" href="#2_Arithmeticoperationsondatesandperiods">
<link title="Operations on years" rel="Section" href="#2_Operationsonyears">
<title>Date_sig.S</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="Date_sig.html">Up</a>
&nbsp;</div>
<center><h1>Module type <a href="type_Date_sig.S.html">Date_sig.S</a></h1></center>
<br>
<pre><span class="keyword">module type</span> S = <code class="code"><span class="keyword">sig</span></code> <a href="Date_sig.S.html">..</a> <code class="code"><span class="keyword">end</span></code></pre>Common operations for all date representations.<br>
<b>Since</b> 2.0 (this signature was before inlined in interface of Date).<br>
<hr width="100%">
<br>
<a name="2_Datatypes"></a>
<h2>Datatypes</h2><br>
<pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type"></code>t </pre>
<div class="info">
Type of a date.<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEday"></a><code class="type"></code>day = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Sun</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Mon</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Tue</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Wed</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Thu</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Fri</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Sat</span></code></td>

</tr></table>

<div class="info">
Days of the week.<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEmonth"></a><code class="type"></code>month = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Jan</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Feb</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Mar</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Apr</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">May</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Jun</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Jul</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Aug</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Sep</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Oct</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Nov</span></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Dec</span></code></td>

</tr></table>

<div class="info">
Months of the year.<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEyear"></a><code class="type"></code>year = <code class="type">int</code> </pre>
<div class="info">
Year as an <code class="code">int</code>.<br>
</div>

<pre><span class="keyword">type</span> <a name="TYPEfield"></a><code class="type"></code>field = <code class="type">[ `Day | `Month | `Week | `Year ]</code> </pre>
<div class="info">
The different fields of a date.<br>
</div>

<br>
<a name="2_Exceptions"></a>
<h2>Exceptions</h2><br>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONOut_of_bounds"></a>Out_of_bounds</pre>
<div class="info">
Raised when a date is outside the Julian period.<br>
</div>
<pre><span class="keyword">exception</span> <a name="EXCEPTIONUndefined"></a>Undefined</pre>
<div class="info">
Raised when a date belongs to 
	<code class="code">[<span class="constructor">October</span> 5th, 1582; <span class="constructor">October</span> 14th, 1582]</code>.<br>
</div>
<br>
<a name="2_Constructors"></a>
<h2>Constructors</h2><br>
<pre><span class="keyword">val</span> <a name="VALmake"></a>make : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int -> int -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">make year month day</code> makes the date year-month-day. A BC year <code class="code">y</code>
	corresponds to the year <code class="code">-(y+1)</code>.<br>
<b>Raises</b><ul><li><code>Out_of_bounds</code> when a date is outside the Julian period.</li>
<li><code>Undefined</code> when a date belongs to <code class="code">[<span class="constructor">October</span> 5th, 1582; <span class="constructor">October</span>
	14th, 1582]</code>.</li>
</ul>
<b>Example:</b> years (5 BC) and (1 BC) respectively correspond to years
	(-4) and 0.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALlmake"></a>lmake : <code class="type">year:<a href="Date_sig.S.html#TYPEyear">year</a> -> ?month:int -> ?day:int -> unit -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Labelled version of <code class="code">make</code>. 
	The default value of <code class="code">month</code> and <code class="code">day</code> is <code class="code">1</code>.<br>
<b>Since</b> 1.05<br>
<b>Raises</b><ul><li><code>Out_of_bounds</code> when a date is outside the Julian period.</li>
<li><code>Undefined</code> when a date belongs to <code class="code">[<span class="constructor">October</span> 5th, 1582; <span class="constructor">October</span>
	14th, 1582]</code>.</li>
</ul>
</div>
<pre><span class="keyword">val</span> <a name="VALtoday"></a>today : <code class="type">unit -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Date of the current day (based on <code class="code"><span class="constructor">Time_Zone</span>.current ()</code>).<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfrom_jd"></a>from_jd : <code class="type">int -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Make a date from its Julian day.<br>
<b>Example:</b> <code class="code">from_jd 0</code> returns the date 4713 BC-1-1.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfrom_mjd"></a>from_mjd : <code class="type">int -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Make a date from its modified Julian day (i.e. Julian day - 2 400 001).
	The Modified Julian day is more manageable than the Julian day.<br>
<b>Example:</b> <code class="code">from_mjd 0</code> returns the date 1858-11-17.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfrom_day_of_year"></a>from_day_of_year : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Make a date from a year and its day of the year.<br>
<b>Since</b> 2.0<br>
<b>Example:</b> <code class="code">from_day_of_year 2008 39</code> returns the date 2008-2-8.<br>
</div>
<br>
<a name="2_Getters"></a>
<h2>Getters</h2><br>
<pre><span class="keyword">val</span> <a name="VALdays_in_month"></a>days_in_month : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Number of days in the month of a date.<br>
<b>Example:</b> <code class="code">days_in_month (make 2003 6 26)</code> returns <code class="code">30</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALday_of_week"></a>day_of_week : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEday">day</a></code></pre><div class="info">
Day of the week.<br>
<b>Example:</b> <code class="code">day_of_week (make 2003 6 26)</code> returns <code class="code"><span class="constructor">Thu</span></code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALday_of_month"></a>day_of_month : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Day of the month.<br>
<b>Example:</b> <code class="code">day_of_month (make 2003 6 26)</code> returns <code class="code">26</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALday_of_year"></a>day_of_year : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Day of the year.<br>
<b>Examples:</b><ul><li><code class="code">day_of_year (make 2003 12 28)</code> returns <code class="code">362</code>.<br>
</li><li><code class="code">day_of_year (make 2003 1 5)</code> returns <code class="code">5</code><br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALweek"></a>week : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Week.<br>
<b>Examples:</b><ul><li><code class="code">week (make 2003 12 29)</code> returns <code class="code">1</code>.<br>
</li><li><code class="code">week (make 2003 12 28)</code> returns <code class="code">52</code>.<br>
</li><li><code class="code">week (make 2000 1 2)</code> returns <code class="code">52</code>.<br>
</li><li><code class="code">week (make 2000 1 3)</code> returns <code class="code">1</code>.<br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALmonth"></a>month : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEmonth">month</a></code></pre><div class="info">
Month.<br>
<b>Example:</b> <code class="code">month (make 2003 6 26)</code> returns <code class="code"><span class="constructor">Jun</span></code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALyear"></a>year : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEyear">year</a></code></pre><div class="info">
Year.<br>
<b>Example:</b> <code class="code">year (make 2003 6 26)</code> returns <code class="code">2003</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALto_jd"></a>to_jd : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Julian day.<br>
<b>Example:</b> <code class="code">to_jd (make (-4712) 1 1)</code> returns 0.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALto_mjd"></a>to_mjd : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Modified Julian day (i.e. Julian day - 2 400 001).
	The Modified Julian day is more manageable than the Julian day.<br>
<b>Example:</b> <code class="code">to_mjd (make 1858 11 17)</code> returns 0.<br>
</div>
<br>
<a name="2_Datesarecomparable"></a>
<h2>Dates are comparable</h2><br>
<pre><span class="keyword">val</span> <a name="VALequal"></a>equal : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEt">t</a> -> bool</code></pre><div class="info">
Equality function between two dates.<br>
<b>Since</b> 1.09.0<br>
<b>See also</b> <a href="Utils.Comparable.html#VALequal">Utils.Comparable.equal</a><br>
</div>
<pre><span class="keyword">val</span> <a name="VALcompare"></a>compare : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Comparison function between two dates.<br>
<b>See also</b> <a href="Utils.Comparable.html#VALcompare">Utils.Comparable.compare</a><br>
</div>
<pre><span class="keyword">val</span> <a name="VALhash"></a>hash : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> int</code></pre><div class="info">
Hash function for dates.<br>
<b>Since</b> 2.0<br>
<b>See also</b> <a href="Utils.Comparable.html#VALhash">Utils.Comparable.hash</a><br>
</div>
<br>
<a name="2_Booleanoperationsondates"></a>
<h2>Boolean operations on dates</h2><br>
<pre><span class="keyword">val</span> <a name="VALis_valid_date"></a>is_valid_date : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int -> int -> bool</code></pre><div class="info">
Check if a date is valid, that is the date has not been coerced to look
	like a real date.<br>
<b>Since</b> 2.0<br>
<b>Examples:</b><ul><li><code class="code">is_valid_date 2008 2 30</code> returns <code class="code"><span class="keyword">false</span></code><br>
</li><li><code class="code">is_valid_date 2008 2 8</code> returns <code class="code"><span class="keyword">true</span></code><br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALis_leap_day"></a>is_leap_day : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> bool</code></pre><div class="info">
Return <code class="code"><span class="keyword">true</span></code> if a date is a leap day
	(i.e. February, 24th of a leap year); <code class="code"><span class="keyword">false</span></code> otherwise.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALis_gregorian"></a>is_gregorian : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> bool</code></pre><div class="info">
Return <code class="code"><span class="keyword">true</span></code> if a date belongs to the Gregorian calendar;
	<code class="code"><span class="keyword">false</span></code> otherwise.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALis_julian"></a>is_julian : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> bool</code></pre><div class="info">
Return <code class="code"><span class="keyword">true</span></code> iff a date belongs to the Julian calendar;
	<code class="code"><span class="keyword">false</span></code> otherwise.<br>
</div>
<br>
<a name="2_Coercions"></a>
<h2>Coercions</h2><br>
<pre><span class="keyword">val</span> <a name="VALto_unixtm"></a>to_unixtm : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> Unix.tm</code></pre><div class="info">
Convert a date into the <code class="code"><span class="constructor">Unix</span>.tm</code> type. 
	The field <code class="code">is_isdst</code> is always <code class="code"><span class="keyword">false</span></code>. The fields <code class="code"><span class="constructor">Unix</span>.tm_sec</code>, 
	<code class="code"><span class="constructor">Unix</span>.tm_min</code> and <code class="code"><span class="constructor">Unix</span>.tm_hour</code> are irrelevant.<br>
<b>Since</b> 1.01<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfrom_unixtm"></a>from_unixtm : <code class="type">Unix.tm -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Inverse of <code class="code">to_unixtm</code>. Assume the current time zone.<br>
<b>Since</b> 1.01<br>
</div>
<pre><span class="keyword">val</span> <a name="VALto_unixfloat"></a>to_unixfloat : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> float</code></pre><div class="info">
Convert a date to a float such than <code class="code">to_unixfloat (make 1970 1 1)</code> 
	returns <code class="code">0.0</code>. So such a float is convertible with those of the <code class="code"><span class="constructor">Unix</span></code> 
	module. The fractional part of the result is always <code class="code">0</code>.<br>
<b>Since</b> 1.01<br>
</div>
<pre><span class="keyword">val</span> <a name="VALfrom_unixfloat"></a>from_unixfloat : <code class="type">float -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Inverse of <code class="code">to_unixfloat</code>. Ignore the fractional part of the argument.
	Assume the current time zone.<br>
<b>Since</b> 1.01<br>
</div>
<pre><span class="keyword">val</span> <a name="VALto_business"></a>to_business : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEyear">year</a> * int * <a href="Date_sig.S.html#TYPEday">day</a></code></pre><div class="info">
Return the "business week" and the day in this week respecting ISO 8601.
	Notice that business weeks at the beginning and end of the year can
	sometimes have year numbers which don't match the real year.<br>
<b>Since</b> 1.09.0<br>
<b>Examples:</b><ul><li><code class="code">to_business (make 2003 12 29)</code> returns <code class="code">2004, 1, <span class="constructor">Mon</span></code>.<br>
</li><li><code class="code">to_business (make 2003 12 28)</code> returns <code class="code">2003, 52, <span class="constructor">Sun</span></code><br>
</li><li><code class="code">to_business (make 2000 1 2)</code> returns <code class="code">1999, 52, <span class="constructor">Sun</span></code><br>
</li><li><code class="code">to_business (make 2000 1 3)</code> returns <code class="code">2000, 1, <span class="constructor">Mon</span></code><br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALfrom_business"></a>from_business : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int -> <a href="Date_sig.S.html#TYPEday">day</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Inverse of <code class="code">to_business</code> respecting ISO-8601.
	Notice that business weeks at the beginning and end of the year
	can sometimes have year numbers which don't match the real year.<br>
<b>Since</b> 1.09.0<br>
<b>Raises</b> <code>Invalid_argument</code> if the date is bad.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALint_of_day"></a>int_of_day : <code class="type"><a href="Date_sig.S.html#TYPEday">day</a> -> int</code></pre><div class="info">
Convert a day to an integer respecting ISO-8601.
	So, Monday is 1, Tuesday is 2, ..., and sunday is 7.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALday_of_int"></a>day_of_int : <code class="type">int -> <a href="Date_sig.S.html#TYPEday">day</a></code></pre><div class="info">
Inverse of <code class="code">int_of_day</code>.<br>
<b>Raises</b> <code>Invalid_argument</code> if the argument does not belong to <code class="code">1; 7</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALint_of_month"></a>int_of_month : <code class="type"><a href="Date_sig.S.html#TYPEmonth">month</a> -> int</code></pre><div class="info">
Convert a month to an integer respecting ISO-8601.
	So, January is 1, February is 2 and so on.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmonth_of_int"></a>month_of_int : <code class="type">int -> <a href="Date_sig.S.html#TYPEmonth">month</a></code></pre><div class="info">
Inverse of <code class="code">int_of_month</code>.<br>
<b>Raises</b> <code>Invalid_argument</code> if the argument does not belong to <code class="code">1; 12</code>.<br>
</div>
<br>
<a name="2_Period"></a>
<h2>Period</h2><br>
<pre><span class="keyword">module</span> <a href="Date_sig.S.Period.html">Period</a>: <code class="code"><span class="keyword">sig</span></code> <a href="Date_sig.S.Period.html">..</a> <code class="code"><span class="keyword">end</span></code></pre><div class="info">
A period is the number of days between two dates.
</div>
<br>
<a name="2_Arithmeticoperationsondatesandperiods"></a>
<h2>Arithmetic operations on dates and periods</h2><br>
<pre><span class="keyword">val</span> <a name="VALadd"></a>add : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> Period.t -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">add d p</code> returns <code class="code">d + p</code>.<br>
<b>Raises</b><ul><li><code>Out_of_bounds</code> when the resulting date is outside the Julian
	period.</li>
<li><code>Undefined</code> when the resulting date belongs to <code class="code">[<span class="constructor">October</span> 5th,
	1582; <span class="constructor">October</span> 14th, 1582]</code>.</li>
</ul>
<b>Examples:</b><ul><li><code class="code">add (make 2003 12 31) (<span class="constructor">Period</span>.month 2)</code> returns the date 
	2004-3-2 (following the coercion rule describes in the introduction).<br>
</li><li><code class="code">add (make 2003 12 31) (<span class="constructor">Period</span>.month 1)</code> returns the date 
	2004-1-31<br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALsub"></a>sub : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEt">t</a> -> Period.t</code></pre><div class="info">
<code class="code">sub d1 d2</code> returns the period between <code class="code">d1</code> and <code class="code">d2</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALrem"></a>rem : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> Period.t -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">rem d p</code> is equivalent to <code class="code">add d (<span class="constructor">Period</span>.opp p)</code>.<br>
<b>Raises</b><ul><li><code>Out_of_bounds</code> when the resulting date is outside the Julian
	period.</li>
<li><code>Undefined</code> when the resulting date belongs to <code class="code">[<span class="constructor">October</span> 5th,
	1582; <span class="constructor">October</span> 14th, 1582]</code>.</li>
</ul>
</div>
<pre><span class="keyword">val</span> <a name="VALnext"></a>next : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEfield">field</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">next d f</code> returns the date corresponding to the next specified field.<br>
<b>Raises</b><ul><li><code>Out_of_bounds</code> when the resulting date is outside the Julian
	period.</li>
<li><code>Undefined</code> when the resulting date belongs to <code class="code">[<span class="constructor">October</span> 5th,
	1582; <span class="constructor">October</span> 14th, 1582]</code>.</li>
</ul>
<b>Example:</b> <code class="code">next (make 2003 12 31) <span class="keywordsign">`</span><span class="constructor">Month</span></code> returns the date 2004-1-31
	(i.e. one month later).<br>
</div>
<pre><span class="keyword">val</span> <a name="VALprev"></a>prev : <code class="type"><a href="Date_sig.S.html#TYPEt">t</a> -> <a href="Date_sig.S.html#TYPEfield">field</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">prev d f</code> returns the date corresponding to the previous specified 
	field.<br>
<b>Raises</b><ul><li><code>Out_of_bounds</code> when the resulting date is outside the Julian
	period.</li>
<li><code>Undefined</code> when the resulting date belongs to <code class="code">[<span class="constructor">October</span> 5th,
	1582; <span class="constructor">October</span> 14th, 1582]</code>.</li>
</ul>
<b>Example:</b> <code class="code">prev (make 2003 12 31) <span class="keywordsign">`</span><span class="constructor">Year</span></code> returns the date 2002-12-31
	(i.e. one year ago).<br>
</div>
<br>
<a name="2_Operationsonyears"></a>
<h2>Operations on years</h2><br>
<pre><span class="keyword">val</span> <a name="VALis_leap_year"></a>is_leap_year : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> bool</code></pre><div class="info">
Return <code class="code"><span class="keyword">true</span></code> if a year is a leap year; <code class="code"><span class="keyword">false</span></code> otherwise.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALsame_calendar"></a>same_calendar : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEyear">year</a> -> bool</code></pre><div class="info">
Return <code class="code"><span class="keyword">true</span></code> if two years have the same calendar; <code class="code"><span class="keyword">false</span></code>
	otherwise.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALdays_in_year"></a>days_in_year : <code class="type">?month:<a href="Date_sig.S.html#TYPEmonth">month</a> -> <a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Number of days in a year. 
<p>

	<code class="code">days_in_year ~month y</code> returns the number of days in the year <code class="code">y</code> up
	to the end of the given month. Thus <code class="code">days_in_year ~month:<span class="constructor">Dec</span> y</code> is the
	same as <code class="code">days_in_year y</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALweeks_in_year"></a>weeks_in_year : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Number of weeks in a year.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALweek_first_last"></a>week_first_last : <code class="type">int -> <a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a> * <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Return the first and last days of a week in a year.<br>
<b>Since</b> 1.08<br>
</div>
<pre><span class="keyword">val</span> <a name="VALnth_weekday_of_month"></a>nth_weekday_of_month : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEmonth">month</a> -> <a href="Date_sig.S.html#TYPEday">day</a> -> int -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">nth_weekday_of_month y m d n</code> returns the <code class="code">n</code>-th day <code class="code">d</code> in the month
	<code class="code">m</code> of the year <code class="code">y</code> (for instance the 3rd Thursday of the month).<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcentury"></a>century : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Century of a year.<br>
<b>Examples:</b><ul><li><code class="code">century 2001</code> returns 21.<br>
</li><li><code class="code">century 2000</code> returns 20<br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALmillenium"></a>millenium : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Millenium of a year.<br>
<b>Examples:</b><ul><li><code class="code">millenium 2001</code> returns 3.<br>
</li><li><code class="code">millenium 2000</code> returns 2<br>
</li></ul></div>
<pre><span class="keyword">val</span> <a name="VALsolar_number"></a>solar_number : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Solar number. 
<p>

	In the Julian calendar there is a one-to-one relationship between the
	Solar number and the day on which a particular date falls.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALindiction"></a>indiction : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Indiction. 
<p>

	The Indiction was used in the middle ages to specify the position of a 
	year in a 15 year taxation cycle. It was introduced by emperor
	Constantine  the Great on 1 September 312 and ceased to be used in
	1806.  
<p>

	The Indiction has no astronomical significance.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALgolden_number"></a>golden_number : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Golden number. 
<p>

	Considering that the relationship between the moon's phases and the
	days  of the year repeats itself every 19 years, it is natural to
	associate a  number between 1 and 19 with each year. 
	This number is the so-called Golden number.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALepact"></a>epact : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> int</code></pre><div class="info">
Epact. 
<p>

	The Epact is a measure of the age of the moon (i.e. the number of days 
	that have passed since an "official" new moon) on a particular date.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALeaster"></a>easter : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Easter Sunday. 
<p>

	In the Christian world, Easter (and the days immediately preceding it)
	is  the celebration of the death and resurrection of Jesus in
	(approximately) AD 30.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcarnaval"></a>carnaval : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Carnaval Monday. <code class="code">carnaval y</code> is <code class="code">easter y - 48</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALmardi_gras"></a>mardi_gras : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Mardi Gras. <code class="code">mardi_gras y</code> is <code class="code">easter y - 47</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALash"></a>ash : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Ash Wednesday. <code class="code">ash y</code> is <code class="code">easter y - 46</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpalm"></a>palm : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Palm Sunday. <code class="code">palm y</code> is <code class="code">easter y - 7</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALeaster_friday"></a>easter_friday : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Easter Friday. <code class="code">easter_friday y</code> is <code class="code">easter y - 2</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALeaster_saturday"></a>easter_saturday : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Easter Saturday. <code class="code">easter_saturday y</code> is <code class="code">easter y - 1</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALeaster_monday"></a>easter_monday : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Easter Monday. <code class="code">easter_monday y</code> is <code class="code">easter y + 1</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALascension"></a>ascension : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Ascension. <code class="code">ascension y</code> is <code class="code">easter y + 39</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALwithsunday"></a>withsunday : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Withsunday. <code class="code">withsunday y</code> is <code class="code">easter y + 49</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALwithmonday"></a>withmonday : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Withmonday. <code class="code">withmonday y</code> is <code class="code">easter y + 50</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcorpus_christi"></a>corpus_christi : <code class="type"><a href="Date_sig.S.html#TYPEyear">year</a> -> <a href="Date_sig.S.html#TYPEt">t</a></code></pre><div class="info">
Feast of Corpus Christi. <code class="code">corpus_christi y</code> is <code class="code">easter + 60</code>.<br>
<b>Since</b> 1.09.0<br>
</div>
</body></html>