17 #include <pia/common/common_definitions.h> 35 m_Year(0), m_Month(0), m_Day(0),
36 m_Hour(0), m_Minute(0), m_Second(0),
49 m_Month = rhs.m_Month;
52 m_Minute = rhs.m_Minute;
53 m_Second = rhs.m_Second;
54 m_IsRegistered = rhs.m_IsRegistered;
67 DateTime(u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second)
75 m_IsRegistered =
true;
85 m_Month = rhs.m_Month;
88 m_Minute = rhs.m_Minute;
89 m_Second = rhs.m_Second;
90 m_IsRegistered = rhs.m_IsRegistered;
102 m_IsRegistered =
true;
122 m_IsRegistered =
true;
142 m_IsRegistered =
true;
162 m_IsRegistered =
true;
182 m_IsRegistered =
true;
202 m_IsRegistered =
true;
220 return m_IsRegistered;
229 if (m_Year == 0 || m_Year > 9999)
233 if (m_Month == 0 || m_Month > 12)
241 else if (m_Month == 2)
243 u8 days = (m_Year % 400 == 0 || (m_Year % 100 != 0 && m_Year % 4 == 0)) ? 29 : 28;
249 else if (m_Month == 4 || m_Month == 6 || m_Month == 9 || m_Month == 11)
289 m_IsRegistered =
false;
bool IsRegistered() const
Gets whether a value has been specified.
Definition: common_DateTime.h:218
void SetDay(u8 day)
Specifies the day.
Definition: common_DateTime.h:139
DateTime & operator=(const DateTime &rhs)
Assignment operator.
Definition: common_DateTime.h:82
bool IsValid() const
Gets whether the specified date and time is correct.
Definition: common_DateTime.h:227
u16 GetYear() const
Gets the specified year.
Definition: common_DateTime.h:109
DateTime()
Instantiates an object with default parameters (default constructor).
Definition: common_DateTime.h:34
u8 GetHour() const
Gets the specified hour.
Definition: common_DateTime.h:169
u8 GetMonth() const
Gets the specified month.
Definition: common_DateTime.h:129
u8 GetSecond() const
Gets the specified seconds.
Definition: common_DateTime.h:209
void SetHour(u8 hour)
Specifies the hour.
Definition: common_DateTime.h:159
void Clear()
Clears the specified date and time.
Definition: common_DateTime.h:281
void SetMonth(u8 month)
Specifies the month.
Definition: common_DateTime.h:119
u8 GetDay() const
Gets the specified day.
Definition: common_DateTime.h:149
virtual ~DateTime()
The destructor.
Definition: common_DateTime.h:295
DateTime(const DateTime &rhs)
The copy constructor.
Definition: common_DateTime.h:46
void SetYear(u16 year)
Specifies the year.
Definition: common_DateTime.h:99
DateTime(u16 year, u8 month, u8 day, u8 hour, u8 minute, u8 second)
Instantiates an object with the specified date and time.
Definition: common_DateTime.h:67
This is the common base class used inside the Pia library.
Definition: common_RootObject.h:40
u8 GetMinute() const
Gets the specified minutes.
Definition: common_DateTime.h:189
void SetSecond(u8 second)
Specifies the seconds.
Definition: common_DateTime.h:199
void SetMinute(u8 minute)
Specifies the minutes.
Definition: common_DateTime.h:179
Class that represents time.
Definition: common_DateTime.h:28