1 /**************************************************************************
2 ** (c) Copyright 1999, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
7 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
8 ** VERSION NUMBER : $Revision: 1.1 $
15 ***************************************************************************
16 ** ADMINISTRATIVE INFORMATION *
17 ********************************
18 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
19 ** CREATION DATE : Feb 06, 1998
20 ** LAST UPDATE : Oct 16, 1999
22 **************************************************************************/
24 /*****************************
26 Revision 1.1 2002-07-25 08:01:26 arjen
27 First checkin, AXE release 0.2
29 *****************************/
31 /* static const char *RCSID = "$Id: date.h,v 1.1 2002-07-25 08:01:26 arjen Exp $"; */
40 unsigned char month, day;
45 date add(unsigned long days);
47 date subtract(unsigned long days);
58 date(unsigned d, unsigned m=0, short y=0)
67 friend date operator+(date, date);
68 friend date operator+(unsigned long, date);
69 friend date operator+(date, unsigned long);
71 date operator += (date D)
76 date operator += (unsigned long l)
81 friend date operator-(unsigned long, date);
82 friend date operator-(date, unsigned long);
83 friend long operator-(date&, date&);
85 date operator -= (unsigned long l)
90 // long(date); // Calculate nr. of days since...
92 int operator==(date d)
96 cm = this->year - d.year;
97 cm = (cm != 0) ? cm : this->month - d.month;
98 cm = (cm != 0) ? cm : this->day - d.day;
103 int operator!=(date d)
107 cm = this->year - d.year;
108 cm = (cm != 0) ? cm : this->month - d.month;
109 cm = (cm != 0) ? cm : this->day - d.day;
114 int operator<=(date d)
118 cm = this->year - d.year;
119 cm = (cm != 0) ? cm : this->month - d.month;
120 cm = (cm != 0) ? cm : this->day - d.day;
125 int operator>=(date d)
129 cm = this->year - d.year;
130 cm = (cm != 0) ? cm : this->month - d.month;
131 cm = (cm != 0) ? cm : this->day - d.day;
136 int operator>(date d)
140 cm = this->year - d.year;
141 cm = (cm != 0) ? cm : this->month - d.month;
142 cm = (cm != 0) ? cm : this->day - d.day;
147 int operator<(date d)
151 cm = this->year - d.year;
152 cm = (cm != 0) ? cm : this->month - d.month;
153 cm = (cm != 0) ? cm : this->day - d.day;
170 String MonthName(void);
179 unsigned DaysInMonth();
181 // date operator*(double)
182 // date& operator*=(double)
183 // date operator/(double)
184 // date& operator/=(double)
186 friend ostream& operator<<(ostream&, const date&);
187 friend istream& operator>>(istream&, date&);
189 String format(const char *fmt = "%x");
197 short minutes, seconds;
208 hour(int hr, short minute, short sec)
217 friend hour operator+(hour &, hour &);
218 hour operator += (hour h);
219 friend hour operator-(hour &, hour &);
221 friend ostream& operator<<(ostream &, const hour &);
236 #endif /* AXE_DATE_H */