Representation of time and date.
NOTE: this class is retained only for compatibility, and has been replaced by wxDateTime. wxTime may be withdrawn in future versions of wxWindows.
Derived from
Include files
<wx/time.h>
Data structures
typedef unsigned short hourTy; typedef unsigned short minuteTy; typedef unsigned short secondTy; typedef unsigned long clockTy; enum tFormat { wx12h, wx24h }; enum tPrecision { wxStdMinSec, wxStdMin };See also
Members
wxTime::wxTime
wxTime::GetDay
wxTime::GetDayOfWeek
wxTime::GetHour
wxTime::GetHourGMT
wxTime::GetMinute
wxTime::GetMinuteGMT
wxTime::GetMonth
wxTime::GetSecond
wxTime::GetSecondGMT
wxTime::GetSeconds
wxTime::GetYear
wxTime::FormatTime
wxTime::IsBetween
wxTime::Max
wxTime::Min
wxTime::SetFormat
wxTime::operator char*
wxTime::operator wxDate
wxTime::operator =
wxTime::operator <
wxTime::operator <=
wxTime::operator >
wxTime::operator >=
wxTime::operator ==
wxTime::operator !=
wxTime::operator +
wxTime::operator -
wxTime::operator +=
wxTime::operator -=
wxTime()
Initialize the object using the current time.
wxTime(clockTy s)
Initialize the object using the number of seconds that have elapsed since ???.
wxTime(const wxTime& time)
Copy constructor.
wxTime(hourTy h, minuteTy m, secondTy s = 0, bool dst = FALSE)
Initialize using hours, minutes, seconds, and whether DST time.
wxTime(const wxDate& date, hourTy h = 0, minuteTy m = 0, secondTy s = 0, bool dst = FALSE)
Initialize using a wxDate object, hours, minutes, seconds, and whether DST time.
int GetDay() const
Returns the day of the month.
int GetDayOfWeek() const
Returns the day of the week, a number from 0 to 6 where 0 is Sunday and 6 is Saturday.
hourTy GetHour() const
Returns the hour in local time.
hourTy GetHourGMT() const
Returns the hour in GMT.
minuteTy GetMinute() const
Returns the minute in local time.
minuteTy GetMinuteGMT() const
Returns the minute in GMT.
int GetMonth() const
Returns the month.
secondTy GetSecond() const
Returns the second in local time or GMT.
secondTy GetSecondGMT() const
Returns the second in GMT.
clockTy GetSeconds() const
Returns the number of seconds since ???.
int GetYear() const
Returns the year.
char* FormatTime() const
Formats the time according to the current formatting options: see wxTime::SetFormat.
bool IsBetween(const wxTime& a, const wxTime& b) const
Returns TRUE if this time is between the two given times.
wxTime Max(const wxTime& time) const
Returns the maximum of the two times.
wxTime Min(const wxTime& time) const
Returns the minimum of the two times.
static void SetFormat(const tFormat format = wx12h, const tPrecision precision = wxStdMinSec)
Sets the format and precision.
operator char*()
Returns a pointer to a static char* containing the formatted time.
operator wxDate() const
Converts the wxTime into a wxDate.
void operator =(const wxTime& t)
Assignment operator.
bool operator <(const wxTime& t) const
Less than operator.
bool operator <=(const wxTime& t) const
Less than or equal to operator.
bool operator >(const wxTime& t) const
Greater than operator.
bool operator >=(const wxTime& t) const
Greater than or equal to operator.
bool operator ==(const wxTime& t) const
Equality operator.
bool operator !=(const wxTime& t) const
Inequality operator.
bool operator +(long sec) const
Addition operator.
bool operator -(long sec) const
Subtraction operator.
bool operator +=(long sec) const
Increment operator.
bool operator -=(long sec) const
Decrement operator.