version 0.3.0
[fms.git] / include / datetime.h
diff --git a/include/datetime.h b/include/datetime.h
deleted file mode 100644 (file)
index cd6df2c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef _date_time_\r
-#define _date_time_\r
-\r
-#include <ctime>\r
-#include <string>\r
-\r
-/*\r
-       Year    actual year\r
-       Month   1=Jan,2=Feb,etc\r
-       Day             1 to last day of month\r
-       Hour    0 to 23\r
-       Minute  0 to 59\r
-       Second  0 to 59\r
-\r
-       WeekDay 0=Sunday,1=Monday,etc\r
-       YearDay 1=Jan 1st, 2=Jan 2nd, etc\r
-\r
-*/\r
-\r
-class DateTime\r
-{\r
-public:\r
-       DateTime();\r
-       DateTime(const time_t &timet);\r
-       DateTime(const struct tm *stm);\r
-       ~DateTime() {}\r
-\r
-       void Add(const int seconds=0, const int minutes=0, const int hours=0, const int days=0, const int months=0, const int years=0);\r
-       \r
-       void Set(const int year=1970, const int month=1, const int day=1, const int hour=0, const int minute=0, const int second=0);\r
-       void SetT(const time_t &timet);\r
-       void Set(const struct tm *stm);\r
-       void Set(const std::string &datestring);        // method only will work with a select few basic input formats\r
-       \r
-       void SetToLocalTime();\r
-       void SetToGMTime();\r
-       \r
-       const int GetYear() const                       { return m_tm.tm_year+1900; }\r
-       void SetYear(const int year)            { m_tm.tm_year=year-1900; }\r
-       const int GetMonth() const                      { return m_tm.tm_mon+1; }\r
-       void SetMonth(const int month)          { m_tm.tm_mon=month-1; }\r
-       const int GetDay() const                        { return m_tm.tm_mday; }\r
-       void SetDay(const int day)                      { m_tm.tm_mday=day; }\r
-       const int GetWeekDay() const            { return m_tm.tm_wday; }\r
-       void SetWeekDay(const int weekday)      { m_tm.tm_wday=weekday; }\r
-       const int GetYearDay() const            { return m_tm.tm_yday+1; }\r
-       void SetYearDay(const int yearday)      { m_tm.tm_yday=yearday-1; }\r
-       const int GetHour() const                       { return m_tm.tm_hour; }\r
-       void SetHour(const int hour)            { m_tm.tm_hour=hour; }\r
-       const int GetMinute() const                     { return m_tm.tm_min; }\r
-       void SetMinute(const int minute)        { m_tm.tm_min=minute; }\r
-       const int GetSecond() const                     { return m_tm.tm_sec; }\r
-       void SetSecond(const int second)        { m_tm.tm_sec=second; }\r
-       const int GetIsDaylightTime() const     { return m_tm.tm_isdst; }\r
-       void SetIsDaylightTime(const int daylighttime) { m_tm.tm_isdst=daylighttime; }\r
-\r
-       void Normalize();                       // normalizes any date changes that were made\r
-       \r
-       std::string Format(const std::string &formatstring) const;\r
-\r
-       DateTime operator+(const double &rhs);\r
-       DateTime operator+(const DateTime &rhs);\r
-       DateTime &operator+=(const double &rhs);\r
-       DateTime &operator+=(const DateTime &rhs);\r
-       DateTime operator-(const double &rhs);\r
-       DateTime operator-(const DateTime &rhs);\r
-       DateTime &operator-=(const double &rhs);\r
-       DateTime &operator-=(const DateTime &rhs);\r
-       \r
-       const bool operator==(const DateTime &rhs) const { return *this==rhs.m_tm; }\r
-       const bool operator==(const time_t &rhs) const { return m_timet==rhs; }\r
-       const bool operator==(const struct tm &rhs) const;\r
-       \r
-       const bool operator<(const DateTime &rhs) const { return (*this<rhs.m_tm); }\r
-       const bool operator<(const time_t &rhs) const { return (m_timet<rhs); }\r
-       const bool operator<(const struct tm &rhs) const;\r
-       \r
-       const bool operator<=(const DateTime &rhs) const { return (*this<rhs.m_tm || *this==rhs.m_tm); }\r
-       const bool operator<=(const time_t &rhs) const { return (m_timet<=rhs); }\r
-       const bool operator<=(const struct tm &rhs) const { return (*this<rhs || *this==rhs); }\r
-       \r
-       const bool operator>(const DateTime &rhs) const { return !(*this<=rhs.m_tm); }\r
-       const bool operator>(const time_t &rhs) const { return (m_timet>rhs); }\r
-       \r
-       const bool operator>=(const DateTime &rhs) const { return !(*this<rhs.m_tm); }\r
-       const bool operator>=(const time_t &rhs) const { return (m_timet>=rhs); }\r
-       \r
-private:\r
-       const time_t TimeGM(struct tm *gmtimein);\r
-\r
-       time_t m_timet;         // don't use timet for any comparisons\r
-       struct tm m_tm;\r
-};\r
-\r
-#endif // _date_time_\r