<!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="#intro">Introduction</a> -- <a href="#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 the Gregorian Calendar. The first introduction of the Gregorian calendar was in 1582 to fix an error in the Julian Calendar. However, many local jurisdictions did not adopt this change until much later. Thus there is potential confusion with historical dates. <p> The implemented calendar is a "propleptic Gregorian calendar" which extends dates back prior to the Gregorian Calendar's first adoption in 1582. The current implementation supports dates in the range 1400-Jan-01 to 10000-Jan-01. Many references will represent dates prior to 1582 using the Julian Calendar, so caution is in order if accurate calculations are required on historic dates. See <A href="http://emr.cs.iit.edu/home/reingold/calendar-book/second-edition/">Calendrical Calculations</A> by Reingold & Dershowitz for more details. Date information from Calendrical Calculations 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 convenience 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 dependency. 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="exp-days_alive.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="exp-dates_as_strings.html">Dates as strings</a></td><td>Simple parsing and formatting of dates from/to strings </td></tr> <tr><td><a href="exp-period_calc.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="exp-print_month.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="exp-print_holidays.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: Sun Feb 9 06:52:31 MST 2003 <!-- hhmts end --> by Jeff Garland © 2000-2002 </small></address> </body> </html>