mirror of
https://github.com/boostorg/date_time.git
synced 2026-02-23 15:42:20 +00:00
79 lines
4.2 KiB
HTML
79 lines
4.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>Gregorian Date System Documentation</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
|
|
<body>
|
|
<a href="../../../index.htm">
|
|
<img align="left" src="../../../c++boost.gif" alt="C++ Boost">
|
|
</a>
|
|
<p>
|
|
<h1>Gregorian Date System Documentation</h1>
|
|
<p> <p>
|
|
<hr>
|
|
|
|
<p>
|
|
<p>
|
|
<a href="index.html">Overall Index</a>
|
|
<p>
|
|
<a href="gregorian.html#intro">Introduction</a> --
|
|
<a href="gregorian.html#usage">Usage Examples</a><p>
|
|
<font class="bold">Temporal Types</font>
|
|
<p>
|
|
<a href="class_date.html">Class date</a> --
|
|
<a href="class_date_duration.html">Class date_duration</a> --
|
|
<a href="class_date_period.html">Class date_period</a>
|
|
<p>
|
|
<font class="bold">Other Topics</font>
|
|
<p>
|
|
<a href="date_iterators.html">Date Iterators</a> --
|
|
<a href="date_algorithms.html">Date Generators / Algorithms</a> --
|
|
<a href="class_gregorian_calendar.html">Class gregorian_calendar</a> --
|
|
<a href="class_date.html#constructfromclock">Class day_clock</a>
|
|
<p>
|
|
<h2><a name="intro">Introduction</a></h2>
|
|
|
|
<p>
|
|
The gregorian date system provides a date programming system based on the Gregorian Calendar. The current implementation supports dates in the range 1400-Jan-01 to 10000-Jan-01. The implemented calendar is a "propleptic Gregorian calendar" thus extending dates back prior to it's first adoption in in 1582.
|
|
|
|
<p>
|
|
Caution is required when handling historic dates as there are many adjustments required to account for the local adoption of various calendar systems.
|
|
See <A href="http://emr.cs.iit.edu/home/reingold/calendar-book/first-edition-index.shtml">Calendrical Calculations</A> by Reingold & Dershowitz for more details. The current historical range of the calendar is not limited by algorithm, but rather time to write and perform tests to ensure correctness. It is expected that the range of this calendar system will continue to increase in the future.
|
|
<p>
|
|
Date information from <A href="http://emr.cs.iit.edu/home/reingold/calendar-book/first-edition-index.shtml">Calendrical Calculations</A> has been used to cross-test the correctness of the Gregorian calendar implementation.
|
|
<p>
|
|
All types for the gregorian system are found in namespace boost::gregorian. The library supports a convience header <font class="el">boost/date_time/gregorian/gregorian_types.hpp</font> that will include all the classes of the library with no input/output depedency.
|
|
Another header <font class="el">boost/date_time/gregorian/gregorian.hpp</font> will include the types and the input/output code.
|
|
<p>
|
|
The class <a href="class_date.html">boost::gregorian::date</a> is the primary
|
|
temporal type for users.
|
|
|
|
If you are interested in learning about writing programs do specialized date calculations such as finding the "first sunday in april" see the <a href="date_algorithms.html">date generators and algorithms page</a>.
|
|
|
|
|
|
<p>
|
|
<h2><a name="usage">Usage Examples</a></h2>
|
|
|
|
<p>
|
|
<table border=1 cellspacing=3 cellpadding=3><tr><td><b>Example</b></td><td><b>Description</b> </td></tr>
|
|
<tr><td><a href="days__alive_8cpp-example.html">Days Alive</a> <a href="exp-days_till_new_year.html">Days Till New Year</a></td><td>Simple date arithmetic. Retrieve current day from clock. </td></tr>
|
|
<tr><td><a href="dates__as__strings_8cpp-example.html">Dates as strings</a></td><td>Simple parsing and formmatting of dates from/to strings </td></tr>
|
|
<tr><td><a href="period__calc_8cpp-example.html">Date Period Calculations</a></td><td>See if a date is in a set of date periods (eg: is it a holiday/weekend) </td></tr>
|
|
<tr><td><a href="print__month_8cpp-example.html">Print a month</a></td><td>Small utility program which prints out all the days in a month from command line. Need to know if 1999-Jan-1 was a Friday or a Saturday? This program shows how to do it. </td></tr>
|
|
<tr><td><a href="print__holidays_8cpp-example.html">Print Holidays</a></td><td>Uses date generators to convert abstract specification into concrete set of dates. </td></table>
|
|
|
|
<p>
|
|
|
|
<hr>
|
|
<address><small>
|
|
<!-- hhmts start -->
|
|
Last modified: Mon Sep 2 18:28:21 MST 2002
|
|
<!-- hhmts end -->
|
|
by Jeff Garland © 2000-2002
|
|
</small></address>
|
|
|
|
</body>
|
|
</html>
|
|
|