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.
|