📄 xdatetime.h
字号:
XLongTime & operator+= (const TDateTime &aDateTime);
XLongTime & operator+= (const XTime &aTime);
//operator-=
XLongTime & operator-= (const XLongTime & aLongTime);
XLongTime & operator-= (XInt aLongTime);
XLongTime & operator-= (const XDateTime &aDateTime);
XLongTime & operator-= (const TDateTime &aDateTime);
XLongTime & operator-= (const XTime &aTime);
//operator==
bool operator==(const XLongTime & aLongTime) const;
bool operator==(XInt aLongTime) const;
bool operator==(const XDateTime &aDateTime) const;
bool operator==(const TDateTime &aDateTime) const;
bool operator==(const XTime &aTime) const;
//operator!=
bool operator!=(const XLongTime & aLongTime) const;
bool operator!=(XInt aLongTime) const;
bool operator!=(const XDateTime &aDateTime) const;
bool operator!=(const TDateTime &aDateTime) const;
bool operator!=(const XTime &aTime) const;
//operator>=
bool operator>=(XInt aLongTime) const;
bool operator>=(const XLongTime & aLongTime) const;
bool operator>=(const XDateTime &aDateTime) const;
bool operator>=(const TDateTime &aDateTime) const;
bool operator>=(const XTime &aTime) const;
//operator<=
bool operator<=(const XLongTime & aLongTime) const;
bool operator<=(XInt aLongTime) const;
bool operator<=(const XDateTime &aDateTime) const;
bool operator<=(const TDateTime &aDateTime) const;
bool operator<=(const XTime &aTime) const;
//operator>
bool operator>(XInt aLongTime) const;
bool operator>(const XLongTime & aLongTime) const;
bool operator>(const XDateTime &aDateTime) const;
bool operator>(const TDateTime &aDateTime) const;
bool operator>(const XTime &aTime) const;
//operator<
bool operator<(const XLongTime & aLongTime) const;
bool operator<(XInt aLongTime) const;
bool operator<(const XDateTime &aDateTime) const;
bool operator<(const TDateTime &aDateTime) const;
bool operator<(const XTime &aTime) const;
//operator ...()
operator XTime() const;
operator XInt() const { return m_LongTime; }
operator TDateTime() const;
operator XDateTime() const;
//method SetLongTime
void SetLongTime(int aHour=0,int aMinute=0,int aSecond=0,int aMillis = 0);
void SetLongTime(const XTime & aTime);
void SetLongTime(const XLongTime & aLongTime);
void SetLongTime(const XDateTime & aDateTime);
void SetLongTime(const TDateTime & aDateTime);
void SetLongTime(const XInt & aLongTime);
//method Add...
void AddHour(int Hours);
void AddMinute(int Minutes);
void AddSecond(int Seconds);
void AddMillis(int aMillis);
//method Sub...
void SubHour(int Hours);
void SubMinute(int Minutes);
void SubSecond(int Seconds);
void SubMillis(int aMillis);
//method GetLongTime
XInt GetLongTime() const { return m_LongTime; }
//method Decode
XTime Decode() const;
void Decode(int & aHour,int & aMinute,int &aSecond,int &aMillis) const;
void Decode(XTime & aTime) const;
//method RoundTime
static XInt RoundTime(XInt aLongTime);
//method CalcLongTime
static XInt CalcLongTime(const XTime & aTime);
static XInt CalcLongTime(const TDateTime & aDateTime);
static XInt CalcLongTime(const XDateTime & aDateTime);
static XInt CalcLongTime(int aHour = 0,int aMinute = 0,int aSecond = 0, int aMillis = 0 );
//property
__property XInt LongTime = { read = GetLongTime, write = SetLongTime };
private:
XInt m_LongTime;
};
class XDateTime
{
public:
XDateTime();
XDateTime(XLong aDateTime);
XDateTime(const XDateTime & aDateTime);
XDateTime(const TDateTime & aDateTime);
XDateTime(const XLongDate & aLongDate,const XLongTime & aLongTime);
XDateTime(const XDate & aDate,const XTime & aTime);
XDateTime(const XDate & aDate);
XDateTime(const XLongDate & aLongDate);
XDateTime(const XTime & aTime);
XDateTime(const XLongTime & aLongTime);
XDateTime(const XDate & aDate,const XLongTime & aLongTime);
XDateTime(const XLongDate & aLongDate,const XTime & aTime);
XDateTime(int aYear,int aMonth,int aDay,int aHour,int aMinute,int aSecond,int aMillis=0);
XDateTime(int aYear,int aMonth,int aDay);
XDateTime(int aHour,int aMinute,int aSecond,int aMillis);
XDateTime & operator=(const XDateTime & aDateTime);
XDateTime & operator=(const TDateTime & aDateTime);
XDateTime & operator=(const XLongDate & aLongDate);
XDateTime & operator=(const XLong & aDateTime);
XDateTime & operator=(const XLongTime & aLongTime);
XDateTime & operator=(const XDate & aDate);
XDateTime & operator=(const XTime & aTime);
XDateTime & operator++();
XDateTime & operator--();
XDateTime operator++(int);
XDateTime operator--(int);
XDateTime & operator+=(XLong aDateTime);
XDateTime & operator+=(const XDateTime & aDateTime );
XDateTime & operator+=(const TDateTime & aDateTime );
XDateTime & operator+=(const XDate & aDate);
XDateTime & operator+=(const XTime & aTime);
XDateTime & operator+=(const XLongDate & aLongDate );
XDateTime & operator+=(const XLongTime & aLongTime );
XDateTime & operator-=(XLong aDateTime);
XDateTime & operator-=(const XDateTime & aDateTime );
XDateTime & operator-=(const TDateTime & aDateTime );
XDateTime & operator-=(const XDate & aDate);
XDateTime & operator-=(const XTime & aTime);
XDateTime & operator-=(const XLongDate & aLongDate );
XDateTime & operator-=(const XLongTime & aLongTime );
XDateTime operator+(XLong aDateTime) const;
XDateTime operator+(const XDateTime & aDateTime ) const;
XDateTime operator+(const TDateTime & aDateTime ) const;
XDateTime operator+(const XDate & aDate) const;
XDateTime operator+(const XTime & aTime) const;
XDateTime operator+(const XLongDate & aLongDate ) const;
XDateTime operator+(const XLongTime & aLongTime ) const;
XDateTime operator-(XLong aDateTime) const;
XDateTime operator-(const XDateTime & aDateTime ) const;
XDateTime operator-(const TDateTime & aDateTime ) const;
XDateTime operator-(const XDate & aDate) const;
XDateTime operator-(const XTime & aTime) const;
XDateTime operator-(const XLongDate & aLongDate ) const;
XDateTime operator-(const XLongTime & aLongTime ) const;
bool operator==(XLong aDateTime) const;
bool operator==(const XDateTime & aDateTime) const;
bool operator==(const TDateTime & aDateTime) const;
bool operator==(const XDate & aDate) const;
bool operator==(const XTime & aTime) const;
bool operator==(const XLongDate & aLongDate) const;
bool operator==(const XLongTime & aLongTime) const;
bool operator!=(XLong aDateTime) const;
bool operator!=(const XDateTime & aDateTime) const;
bool operator!=(const TDateTime & aDateTime) const;
bool operator!=(const XDate & aDate) const;
bool operator!=(const XTime & aTime) const;
bool operator!=(const XLongDate & aLongDate) const;
bool operator!=(const XLongTime & aLongTime) const;
bool operator>=(XLong aDateTime) const;
bool operator>=(const XDateTime & aDateTime) const;
bool operator>=(const TDateTime & aDateTime) const;
bool operator>=(const XDate & aDate) const;
bool operator>=(const XTime & aTime) const;
bool operator>=(const XLongDate & aLongDate) const;
bool operator>=(const XLongTime & aLongTime) const;
bool operator<=(XLong aDateTime) const;
bool operator<=(const XDateTime & aDateTime) const;
bool operator<=(const TDateTime & aDateTime) const;
bool operator<=(const XDate & aDate) const;
bool operator<=(const XTime & aTime) const;
bool operator<=(const XLongDate & aLongDate) const;
bool operator<=(const XLongTime & aLongTime) const;
bool operator>(XLong aDateTime) const;
bool operator>(const XDateTime & aDateTime) const;
bool operator>(const TDateTime & aDateTime) const;
bool operator>(const XDate & aDate) const;
bool operator>(const XTime & aTime) const;
bool operator>(const XLongDate & aLongDate) const;
bool operator>(const XLongTime & aLongTime) const;
bool operator<(XLong aDateTime) const;
bool operator<(const XDateTime & aDateTime) const;
bool operator<(const TDateTime & aDateTime) const;
bool operator<(const XDate & aDate) const;
bool operator<(const XTime & aTime) const;
bool operator<(const XLongDate & aLongDate) const;
bool operator<(const XLongTime & aLongTime) const;
void AddMillis(XLong aMillis);
void AddSecond(XLong aSeconds);
void AddMinute(XLong aMinutes);
void AddHour(XLong aHours);
void AddDay(int aDays);
void SubMillis(XLong aMillis);
void SubSecond(XLong aSeconds);
void SubMinute(XLong aMinutes);
void SubHour(XLong aHours);
void SubDay(int aDays);
void SetDateTime();
void SetDateTime(XLong aDateTime);
void SetDateTime(const XDateTime & aDateTime);
void SetDateTime(const TDateTime & aDateTime);
void SetDateTime(const XLongDate & aLongDate,const XLongTime & aLongTime);
void SetDateTime(const XDate & aDate,const XTime & aTime);
void SetDateTime(const XDate & aDate);
void SetDateTime(const XLongDate & aLongDate);
void SetDateTime(const XTime & aTime);
void SetDateTime(const XLongTime & aLongTime);
void SetDateTime(const XDate & aDate,const XLongTime & aLongTime);
void SetDateTime(const XLongDate & aLongDate,const XTime & aTime);
void SetDateTime(int aYear,int aMonth,int aDay,int aHour,int aMinute,int aSecond,int aMillis=0);
void SetDateTime(int aYear,int aMonth,int aDay);
void SetDateTime(int aHour,int aMinute,int aSecond,int aMillis);
static XLong RoundDateTime(XLong aDateTime);
static XLong CalcDateTime(const XDate & aDate);
static XLong CalcDateTime(const XTime & aTime);
static XLong CalcDateTime(const XLongDate & aLongDate);
static XLong CalcDateTime(const XLongTime & aLongTime);
static XLong CalcDateTime(const TDateTime & aDateTime);
static XLong CalcDateTime(int aYear,int aMonth,int aDay);
static XLong CalcDateTime(int aHour,int aMinute,int aSecond,int aMillis);
static XLong CalcDateTime(int aYear,int aMonth,int aDay,int aHour,int aMinute,int aSecond,int aMillis);
XTime DecodeTime() const;
void DecodeTime( XTime & aTime ) const;
void DecodeTime( int & aHour,int & aMinute, int & aSecond, int & aMillis ) const;
XDate DecodeDate() const;
void DecodeDate(XDate & aDate) const;
void DecodeDate(int &aYear,int &aMonth,int & aDay) const;
operator XTime() const;
operator XDate() const;
operator XLongTime() const;
operator XLongDate() const;
operator TDateTime() const;
operator XLong() const { return m_DateTime; }
XLong GetDateTime() const { return m_DateTime; }
int GetLongTime() const;
int GetLongDate() const;
private:
XLong m_DateTime;
};
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -