## wxTime

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

wxObject

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

wxDate

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::wxTime

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.

### wxTime::GetDay

int GetDay() const

Returns the day of the month.

### wxTime::GetDayOfWeek

int GetDayOfWeek() const

Returns the day of the week, a number from 0 to 6 where 0 is Sunday and 6 is Saturday.

### wxTime::GetHour

hourTy GetHour() const

Returns the hour in local time.

### wxTime::GetHourGMT

hourTy GetHourGMT() const

Returns the hour in GMT.

### wxTime::GetMinute

minuteTy GetMinute() const

Returns the minute in local time.

### wxTime::GetMinuteGMT

minuteTy GetMinuteGMT() const

Returns the minute in GMT.

### wxTime::GetMonth

int GetMonth() const

Returns the month.

### wxTime::GetSecond

secondTy GetSecond() const

Returns the second in local time or GMT.

### wxTime::GetSecondGMT

secondTy GetSecondGMT() const

Returns the second in GMT.

### wxTime::GetSeconds

clockTy GetSeconds() const

Returns the number of seconds since ???.

### wxTime::GetYear

int GetYear() const

Returns the year.

### wxTime::FormatTime

char* FormatTime() const

Formats the time according to the current formatting options: see wxTime::SetFormat.

### wxTime::IsBetween

bool IsBetween(const wxTime& a, const wxTime& b) const

Returns TRUE if this time is between the two given times.

### wxTime::Max

wxTime Max(const wxTime& time) const

Returns the maximum of the two times.

### wxTime::Min

wxTime Min(const wxTime& time) const

Returns the minimum of the two times.

### wxTime::SetFormat

static void SetFormat(const tFormat format = wx12h, const tPrecision precision = wxStdMinSec)

Sets the format and precision.

### wxTime::operator char*

operator char*()

Returns a pointer to a static char* containing the formatted time.

### wxTime::operator wxDate

operator wxDate() const

Converts the wxTime into a wxDate.

### wxTime::operator =

void operator =(const wxTime& t)

Assignment operator.

### wxTime::operator <

bool operator <(const wxTime& t) const

Less than operator.

### wxTime::operator <=

bool operator <=(const wxTime& t) const

Less than or equal to operator.

### wxTime::operator >

bool operator >(const wxTime& t) const

Greater than operator.

### wxTime::operator >=

bool operator >=(const wxTime& t) const

Greater than or equal to operator.

### wxTime::operator ==

bool operator ==(const wxTime& t) const

Equality operator.

### wxTime::operator !=

bool operator !=(const wxTime& t) const

Inequality operator.

### wxTime::operator +

bool operator +(long sec) const

Addition operator.

### wxTime::operator -

bool operator -(long sec) const

Subtraction operator.

### wxTime::operator +=

bool operator +=(long sec) const

Increment operator.

### wxTime::operator -=

bool operator -=(long sec) const

Decrement operator.