.\" This is a wxWidgets manpage page generated from the XML docs .TH wxTimeSpan 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxTimeSpan \- A time interval. .SH DESCRIPTION wxTimeSpan class represents a time interval. .SH "PARENTS" .SH "INCLUDE FILES" wx/datetime.h .SH MEMBERS .SS wxTimeSpan Abs () Returns the absolute value of the timespan: does not modify the object. .SS wxTimeSpan Add (const wxTimeSpan& diff) .SS wxTimeSpan& Add (const wxTimeSpan& diff) .SS wxTimeSpan& operator+= (const wxTimeSpan&diff) Returns the sum of two timespans. .SS static wxTimespan Days (long days) Returns the timespan for the given number of days. .SS static wxTimespan Day () Returns the timespan for one day. .SS wxString Format (const wxChar * format = wxDefaultTimeSpanFormat) Returns the string containing the formatted representation of the time span. The following format specifiers are allowed after %: H number of H ours M number of M inutes S number of S econds l number of mi l liseconds D number of D ays E number of w E eks % the percent character 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. .SS int GetDays () Returns the difference in number of days. .SS int GetHours () Returns the difference in number of hours. .SS wxLongLong GetMilliseconds () Returns the difference in number of milliseconds. .SS int GetMinutes () Returns the difference in number of minutes. .SS wxLongLong GetSeconds () Returns the difference in number of seconds. .SS wxLongLong GetValue () Returns the internal representation of timespan. .SS int GetWeeks () Returns the difference in number of weeks. .SS static wxTimespan Hours (long hours) Returns the timespan for the given number of hours. .SS static wxTimespan Hour () Returns the timespan for one hour. .SS bool IsEqualTo (const wxTimeSpan& ts) Returns true if two timespans are equal. .SS bool IsLongerThan (const wxTimeSpan& ts) 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. .SS bool IsNegative () Returns true if the timespan is negative. .SS bool IsNull () Returns true if the timespan is empty. .SS bool IsPositive () Returns true if the timespan is positive. .SS bool IsShorterThan (const wxTimeSpan& ts) 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. .SS static wxTimespan Minutes (long min) Returns the timespan for the given number of minutes. .SS static wxTimespan Minute () Returns the timespan for one minute. .SS wxTimeSpan Multiply (int n) .SS wxTimeSpan& Multiply (int n) .SS wxTimeSpan& operator*= (int n) Multiplies timespan by a scalar. .SS wxTimeSpan Negate () Returns timespan with inverted sign. .SS wxTimeSpan& Neg () .SS wxTimeSpan& operator- () Negate the value of the timespan. .SS static wxTimespan Seconds (long sec) Returns the timespan for the given number of seconds. .SS static wxTimespan Second () Returns the timespan for one second. .SS wxTimeSpan Subtract (const wxTimeSpan&diff) .SS wxTimeSpan& Subtract (const wxTimeSpan& diff) .SS wxTimeSpan& operator-= (const wxTimeSpan&diff) Returns the difference of two timespans. .SS static wxTimespan Weeks (long weeks) Returns the timespan for the given number of weeks. .SS static wxTimespan Week () Returns the timespan for one week. .SS wxTimeSpan () Default constructor, constructs a zero timespan. .SS wxTimeSpan (long hourslong minlong seclong 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. .SH "SEE ALSO" Date classes overview , wxDateTime .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.