Initial revision
[ACL.git] / doc / date.html
1 <HTML>
2 <HEAD>
3 <TITLE>date - ANDROMEDA CLASS LIBRARY</TITLE>
4 <!--Created by Applixware HTML Authoring System, Release 4.3 on Fri Jun 19 13:37:32 1998-->
5 </HEAD>
6 <BODY BGCOLOR="#ffffff">
7 <H2>NAME</H2>
8 <P>date - Date class</P>
9 <H2>SYNOPSIS</H2>
10 <PRE>
11 <P>#include <date.h >
12
13 date d;</P>
14 </PRE>
15 <H2>DESCRIPTION</H2>
16 <P>The <I>date</I> class encapsulates the concept of a calender date. It holds
17 a day and a month, both between 0 and 255, and a year ranging from -32768 to
18 +32767. Although full-range dates can be usefull in calulations, a real date
19 should have a day between 1 and 31 inclusive, and a month between 1 and 12.
20 All calculations with dates are based on the Julian calendar.</P>
21 <H3>Construction</H3>
22 <H5>date()</H5>
23 <P>The default constructor sets all elements (day, month and year) to 0.
24 </P>
25 <H5>date(unsigned day, unsigned month=0, short year=0)</H5>
26 <H5>date(unsigned day, string month, short year)</H5>
27 <H5>date(string s)</H5>
28 <H3>Assignment</H3>
29 <H5>operator=(date &amp;d)</H5>
30 <H5>operator=(string &amp;s)</H5>
31 <H3>Conversion</H3>
32 <H5>long()</H5>
33 <P>Converts to the Julian date number. This is the number of days since the
34 base date of the Julian calendar.</P>
35 <H5>string()</H5>
36 <P>Converts a date to an ASCII format.</P>
37 <H3>Relational operations</H3>
38 <H5>operator==(date d)</H5>
39 <H5>operator!=(date d)</H5>
40 <H5>operator&lt;(date d)</H5>
41 <H5>operator&lt;=(date d)</H5>
42 <H5>operator&gt;(date d)</H5>
43 <H5>operator&gt;=(date d)</H5>
44 <H3>Attributes</H3>
45 <H5>unsigned day()</H5>
46 <H5>unsigned month()</H5>
47 <H5>short year()</H5>
48 <H3>Operations</H3>
49 <H5>int Leap()</H5>
50 <P>Returns TRUE if this year is a leapyear. If this year is not a leapyear, 
51 <TT>leap()</TT> returns 0.</P>
52 <H5>unsigned DaysInMonth()</H5>
53 <P>Returns the number of days in this month, or zero if the month is not
54 between 1 and 12.</P>
55 <H5>unsigned WeekDay()</H5>
56 <H5>string DayName()</H5>
57 <H5>string MonthName()</H5>
58 <H3>Arithmetic</H3>
59 <H5>date operator+(date &amp;d1, date &amp;d2)</H5>
60 <H5>date operator+=(date &amp;d)</H5>
61 <H5>date operator+(long l, date &amp;d)</H5>
62 <H5>date operator+(date &amp;d, long l)</H5>
63 <H5>date operator+=(long l)</H5>
64 <P>Add l days to the date.</P>
65 <H5>long operator-(date &amp;d1, date &amp;d2)</H5>
66 <P>Calculate the number of days from d1 to d2.</P>
67 <H5>date operator-(date &amp;d1, date &amp;d2)</H5>
68 <H5>date operator-=(date &amp;d)</H5>
69 <P>Subtract a number of days, months and years from the left-hand date.
70 </P>
71 <H5>date operator-=(long l)</H5>
72 <P>Subtract l days.</P>
73 <H5>date operator++()</H5>
74 <H5>date operator--()</H5>
75 <H3>Stream I/O</H3>
76 <H2>SEE ALSO</H2>
77 <P><A HREF="hour.html">hour</A><A HREF="UTC.html"> UTC</A></P>
78 <H2>DIAGNOSTICS</H2>
79 </BODY>
80 </HTML>