wxTimeSpanwxTimeSpan class represents a time interval. Derived from No base class Include files <wx/datetime.h> See also Date classes overview, wxDateTime Function groups
Static functions
Static functions
Milliseconds
Constructors
Accessors
GetSeconds
Operations
Add
Tests
IsNull
Formatting time spans
wxTimeSpan::AbswxTimeSpan Abs() const Returns the absolute value of the timespan: does not modify the object.
wxTimeSpan::AddwxTimeSpan Add(const wxTimeSpan& diff) const wxTimeSpan& Add(const wxTimeSpan& diff) wxTimeSpan& operator+=(const wxTimeSpan&diff) Returns the sum of two timespans.
wxTimeSpan::Daysstatic wxTimespan Days(long days) Returns the timespan for the given number of days.
wxTimeSpan::Daystatic wxTimespan Day() Returns the timespan for one day.
wxTimeSpan::FormatwxString Format(const wxChar * format = wxDefaultTimeSpanFormat) Returns the string containing the formatted representation of the time span. The following format specifiers are allowed after %:
Note that, for example, the number of hours in the description above is not well defined: it can be either the total number of hours (for example, for a time span of 50 hours this would be 50) or just the hour part of the time span, which would be 2 in this case as 50 hours is equal to 2 days and 2 hours. wxTimeSpan resolves this ambiguity in the following way: if there had been, indeed, the %D format specified preceding the %H, then it is interpreted as 2. Otherwise, it is 50. The same applies to all other format specifiers: if they follow a specifier of larger unit, only the rest part is taken, otherwise the full value is used.
wxTimeSpan::GetDaysint GetDays() const Returns the difference in number of days.
wxTimeSpan::GetHoursint GetHours() const Returns the difference in number of hours.
wxTimeSpan::GetMillisecondswxLongLong GetMilliseconds() const Returns the difference in number of milliseconds.
wxTimeSpan::GetMinutesint GetMinutes() const Returns the difference in number of minutes.
wxTimeSpan::GetSecondswxLongLong GetSeconds() const Returns the difference in number of seconds.
wxTimeSpan::GetValuewxLongLong GetValue() const Returns the internal representation of timespan.
wxTimeSpan::GetWeeksint GetWeeks() const Returns the difference in number of weeks.
wxTimeSpan::Hoursstatic wxTimespan Hours(long hours) Returns the timespan for the given number of hours.
wxTimeSpan::Hourstatic wxTimespan Hour() Returns the timespan for one hour.
wxTimeSpan::IsEqualTobool IsEqualTo(const wxTimeSpan& ts) const Returns true if two timespans are equal.
wxTimeSpan::IsLongerThanbool IsLongerThan(const wxTimeSpan& ts) const Compares two timespans: works with the absolute values, i.e. -2 hours is longer than 1 hour. Also, it will return false if the timespans are equal in absolute value.
wxTimeSpan::IsNegativebool IsNegative() const Returns true if the timespan is negative.
wxTimeSpan::IsNullbool IsNull() const Returns true if the timespan is empty.
wxTimeSpan::IsPositivebool IsPositive() const Returns true if the timespan is positive.
wxTimeSpan::IsShorterThanbool IsShorterThan(const wxTimeSpan& ts) const Compares two timespans: works with the absolute values, i.e. 1 hour is shorter than -2 hours. Also, it will return false if the timespans are equal in absolute value.
wxTimeSpan::Minutesstatic wxTimespan Minutes(long min) Returns the timespan for the given number of minutes.
wxTimeSpan::Minutestatic wxTimespan Minute() Returns the timespan for one minute.
wxTimeSpan::MultiplywxTimeSpan Multiply(int n) const wxTimeSpan& Multiply(int n) wxTimeSpan& operator*=(int n) Multiplies timespan by a scalar.
wxTimeSpan::NegatewxTimeSpan Negate() const Returns timespan with inverted sign.
wxTimeSpan::NegwxTimeSpan& Neg() wxTimeSpan& operator-() Negate the value of the timespan.
wxTimeSpan::Millisecondsstatic wxTimespan Milliseconds(long ms) Returns the timespan for the given number of milliseconds.
wxTimeSpan::Millisecondstatic wxTimespan Millisecond() Returns the timespan for one millisecond.
wxTimeSpan::Secondsstatic wxTimespan Seconds(long sec) Returns the timespan for the given number of seconds.
wxTimeSpan::Secondstatic wxTimespan Second() Returns the timespan for one second.
wxTimeSpan::SubtractwxTimeSpan Subtract(const wxTimeSpan&diff) const wxTimeSpan& Subtract(const wxTimeSpan& diff) wxTimeSpan& operator-=(const wxTimeSpan&diff) Returns the difference of two timespans.
wxTimeSpan::Weeksstatic wxTimespan Weeks(long weeks) Returns the timespan for the given number of weeks.
wxTimeSpan::Weekstatic wxTimespan Week() Returns the timespan for one week.
wxTimeSpan::wxTimeSpanwxTimeSpan() Default constructor, constructs a zero timespan. wxTimeSpan(long hours, long min, long sec, long msec) Constructs timespan from separate values for each component, with the date set to 0. Hours are not restricted to 0..24 range, neither are minutes, seconds or milliseconds.
|