date d;
</pre>
<para>
-The <emph>date</emph> class encapsulates the concept of a calender date. It holds
+The <emph>date</emph> class encapsulates the concept of a date, represented by
+days, months and years. It holds
a day and a month, both between 0 and 255, and a year ranging from -32768 to
+32767. Although full-range dates can be usefull in calulations, a real date
should have a day between 1 and 31 inclusive, and a month between 1 and 12.
+Only such dates can be used as proper calender dates.
+A different kind of date may be used as a relative date to perform calculations.
+For example, to add 2 years, 3 months and 6 days to a date, a date like (6, 3, 2) can be created.
All calculations with dates are based on the Julian calendar.
+</para>
+<para>
+Parsing text into a date object is a challenging task.
+Partly because there are many ways to write dates but also because some
+ways to write a date are ambiguous.
+For example, the date 8-2-12 could mean August 2nd 2012, 12th of February 2008
+or 8th of February 2012.
+These are some ways to write February 8th 2012 that are supported by the parser:
+<itemize>
+<item>20120208</item>
+<item>2012-02-08</item>
+<item>2012 02 08</item>
+<item>08-02-2012</item>
+<item>02/08/2012</item>
+<item>Feb 8 2012</item>
+<item>2012 Feb 8</item>
+<item>8 FEB 2012</item>
+<item>2012 8 feb</item>
+<item>8 February 2012</item>
+</itemize>
+
</para>
<section>
The default constructor sets all elements (day, month and year) to 0.
</item>
<item tag="date(unsigned day, unsigned month=0, short year=0)">
+Constructs a date object with the specified year, month and day.
+For this date object to be a proper calendar date, the month must be between
+1 and 12 an the day myst be between 1 and the number of days in that month.
</item>
-<item tag=">date(unsigned day, string month, short year)">
+<item tag="date(unsigned day, string month, short year)">
</item>
<item tag="date(string s)">
</item>
<description>
<item tag="operator=(date &d)">
</item>
-<item tag=">operator=(string &s)">
+<item tag="operator=(string &s)">
+Parse string s and extract a day, month and year if the string contains an actual date.
</item>
</description>
</section>
<section>
<heading>Relational operations</heading>
+<para>
+The relational operators are defined with obvious meanings:
+</para>
<description>
<item tag="operator==(date d)">
</item>
between 1 and 12.
</item>
<item tag="unsigned WeekDay()">
+Calculate the day of the week, where 1 is Monday and 7 is Sunday.
+If the date is not a proper calendar date, return 0.
</item>
<item tag="string DayName()">
</item>
<item tag="string MonthName()">
</item>
+<item tag="string WeekNumber()">
+Calculate the number of the week within the year.
+</item>
</description>
</section>
<heading>Arithmetic</heading>
<description>
<item tag="date operator+(date &d1, date &d2)">
+Add a number of days, months and years to a date.
+This is most usefull if one of the dates is a proper calendar date
+and the other is not.
</item>
<item tag="date operator+=(date &d)">
</item>
<item tag="date operator+(long l, date &d)">
+Add a number of days to a date.
</item>
<item tag="date operator+(date &d, long l)">
</item>
--- /dev/null
+<?xml version='1.0'?>
+<chapter>
+
+<heading> hour - Time class </heading>
+<pre>
+#include <date.h>
+
+hour t;
+</pre>
+<para>
+The <emph>hour</emph> class encapsulates a time in hours, minutes and seconds.
+Most operators are defined to provide calculations just like integer numbers.
+</para>
+
+<section>
+<heading>Construction and assigment</heading>
+
+<para>
+Objects of class <emph>hour</emph> can be constructed and assigned from integer numbers,
+String objects or other hour objects.
+</para>
+<description>
+<item tag='hour()'>
+</item>
+<item tag='hour(long)'>
+A number of seconds.
+</item>
+<item tag='hour(int hour, short minute, short second)'>
+</item>
+<item tag='hour(const String)'>
+
+Format is HH:MM:SS
+
+</item>
+
+<item tag='operator=(hour &)'>
+</item>
+<item tag='operator=(string &)'>
+</item>
+<item tag='operator=(long)'>
+</item>
+</description>
+
+</section>
+
+<section>
+<heading>Conversion</heading>
+
+<description>
+<item tag='long()'>
+
+Converts to a number of seconds.
+</item>
+
+<item tag='String()'>
+</item>
+</description>
+
+</section>
+<section>
+<heading>Relational operations</heading>
+
+<description>
+<item tag='operator==(hour &)'>
+</item>
+<item tag='>operator!=(hour &)'>
+</item>
+<item tag='operator<(hour &)'>
+</item>
+<item tag='operator<=(hour &)'>
+</item>
+<item tag='operator>(hour &)'>
+</item>
+<item tag='operator>=(hour &)'>
+</item>
+</description>
+
+</section>
+<section>
+<heading>Attributes</heading>
+
+<description>
+<item tag='int hour()'>
+</item>
+<item tag='short minute()'>
+</item>
+<item tag='short second()'>
+</item>
+</description>
+
+</section>
+<section>
+<heading>Arithmetic</heading>
+
+<description>
+<item tag='hour operator+(hour &t1, hour &t2)'>
+</item>
+<item tag='hour operator-(hour &t1, hour &t2)'>
+</item>
+<item tag='hour &operator+=(hour &t)'>
+</item>
+<item tag='hour &operator-=(hour &t)'>
+</item>
+<item tag='hour &operator++()'>
+</item>
+<item tag='hour &operator--()'>
+</item>
+</description>
+
+</section>
+<section>
+<heading>Stream I/O</heading>
+
+<description>
+<item tag='ostream &operator<<(ostream &str, hour &t)'>
+</item>
+<item tag='istream &operator>>(istream &str, hour &t)'>
+</item>
+</description>
+
+</section>
+<section>
+<heading> SEE ALSO</heading>
+
+<a href="date.html">date</a>
+<a href="UTC.html">UTC</a>
+
+
+</section>
+</chapter>