class Nuller; class Stream; struct FileTime; struct Date : RelOps< Date, Moveable > { byte day; byte month; int16 year; void Serialize(Stream& s); bool IsValid() const; void Set(int scalar); int Get() const; static Date Low() { return Date(-4000, 1, 1); } static Date High() { return Date(4000, 1, 1); } int Compare(Date b) const; Date() { year = -32768; day = month = 0; } Date(const Nuller&) { year = -32768; day = month = 0; } Date(int y, int m, int d) { day = d; month = m; year = y; } }; inline unsigned GetHashValue(Date t) { return 512 * t.year + 32 * t.month + t.day; } inline bool operator==(Date a, Date b) { return a.day == b.day && a.month == b.month && a.year == b.year; } bool operator<(Date a, Date b); int operator-(Date a, Date b); Date operator+(Date a, int b); Date operator+(int a, Date b); Date operator-(Date a, int b); Date& operator+=(Date& a, int b); Date& operator-=(Date& a, int b); bool IsLeapYear(int year); int GetDaysOfMonth(int m, int y); int DayOfWeek(Date date); Date LastDayOfMonth(Date d); Date FirstDayOfMonth(Date d); Date LastDayOfYear(Date d); Date FirstDayOfYear(Date d); Date AddMonths(Date date, int months); Date AddYears(Date date, int years); Date GetSysDate(); String DayName(int i, int lang = 0); String DyName(int i, int lang = 0); String MonthName(int i, int lang = 0); String MonName(int i, int lang = 0); void SetDateFormat(const char *fmt); void SetDateScan(const char *scan); void SetDateFilter(const char *seps); const char *StrToDate(Date& d, const char *s); String Format(Date date); int CharFilterDate(int c); template<> inline String AsString(const Date& date) { return Format(date); } struct Time : Date, RelOps< Time, Moveable