Classes: \helpref{wxDateTime}{wxdatetime}, \helpref{wxDateSpan}{wxdatespan}, \helpref{wxTimeSpan}{wxtimespan}, \helpref{wxCalendarCtrl}{wxcalendarctrl}
Classes: \helpref{wxDateTime}{wxdatetime}, \helpref{wxDateSpan}{wxdatespan}, \helpref{wxTimeSpan}{wxtimespan}, \helpref{wxCalendarCtrl}{wxcalendarctrl}
There are 3 main classes declared in {\tt <wx/datetime.h>}: except
\helpref{wxDateTime}{wxdatetime} itself which represents an absolute
There are 3 main classes declared in {\tt <wx/datetime.h>}: except
\helpref{wxDateTime}{wxdatetime} itself which represents an absolute
-moment in the time, there are also two classes -
-\helpref{wxTimeSpan}{wxtimespan} and \helpref{wxDateSpan}{wxdatespan} which
+moment in time, there are also two classes -
+\helpref{wxTimeSpan}{wxtimespan} and \helpref{wxDateSpan}{wxdatespan} - which
represent the intervals of time.
There are also helper classes which are used together with wxDateTime:
represent the intervals of time.
There are also helper classes which are used together with wxDateTime:
wxTime classes. \helpref{These classes}{tdatecompatibility} are obsolete and
superseded by wxDateTime.
wxTime classes. \helpref{These classes}{tdatecompatibility} are obsolete and
superseded by wxDateTime.
\helpref{wxDateTime}{wxdatetime} stores the time as a signed number of
milliseconds since the Epoch which is fixed, by convention, to Jan 1, 1970 -
\helpref{wxDateTime}{wxdatetime} stores the time as a signed number of
milliseconds since the Epoch which is fixed, by convention, to Jan 1, 1970 -
While there is only one logical way to represent an absolute moment in the
time (and hence only one wxDateTime class), there are at least two methods to
While there is only one logical way to represent an absolute moment in the
time (and hence only one wxDateTime class), there are at least two methods to
First, there is the direct and self-explaining way implemented by
\helpref{wxTimeSpan}{wxtimespan}: it is just a difference in milliseconds
First, there is the direct and self-explaining way implemented by
\helpref{wxTimeSpan}{wxtimespan}: it is just a difference in milliseconds
wxDateTime is always well-defined and is a fast operation.
But in the daily life other, calendar-dependent time interval specifications are
wxDateTime is always well-defined and is a fast operation.
But in the daily life other, calendar-dependent time interval specifications are
-\helpref{wxDateSpan}{wxdatespan}. It handles this sort of operations in the
-most natural way possible, but note that manipulating with thei ntervals of
+\helpref{wxDateSpan}{wxdatespan}. It handles these sort of operations in the
+most natural way possible, but note that manipulating with intervals of
this kind is not always well-defined. Consider, for example, Jan 31 + `1
month': this will give Feb 28 (or 29), i.e. the last day of February and not
this kind is not always well-defined. Consider, for example, Jan 31 + `1
month': this will give Feb 28 (or 29), i.e. the last day of February and not
-the non-existing Feb 31. Of course, this is what is usually wanted, but you
-still might be surprized to notice that now substracting back the same
+the non-existent Feb 31. Of course, this is what is usually wanted, but you
+still might be surprised to notice that now subtracting back the same
interval from Feb 28 will result in Jan 28 and {\bf not} Jan 31 we started
with!
So, unless you plan to implement some kind of natural language parsing in the
program, you should probably use wxTimeSpan instead of wxDateSpan (which is
also more efficient). However, wxDateSpan may be very useful in situations
interval from Feb 28 will result in Jan 28 and {\bf not} Jan 31 we started
with!
So, unless you plan to implement some kind of natural language parsing in the
program, you should probably use wxTimeSpan instead of wxDateSpan (which is
also more efficient). However, wxDateSpan may be very useful in situations
just {\tt wxDateTime::Now() + wxDateSpan::Month()}).
\subsection{Date arithmetics}\label{tdatearithm}
Many different operations may be performed with the dates, however not all of
just {\tt wxDateTime::Now() + wxDateSpan::Month()}).
\subsection{Date arithmetics}\label{tdatearithm}
Many different operations may be performed with the dates, however not all of
-them make sense. For example, multiplying date by a number is an invalid
-operation, even though multiplying either of time span classes by a number is
-perfectly valid.
+them make sense. For example, multiplying a date by a number is an invalid
+operation, even though multiplying either of the time span classes by a number
+is perfectly valid.
-can be added together giving another object of the smae class.}
-\item{{\bf Substraction}}{the same types of operations as above are
+can be added together giving another object of the same class.}
+\twocolitem{{\bf Subtraction}}{the same types of operations as above are
allowed and, additionally, a difference between two wxDateTime objects can be
taken and this will yield wxTimeSpan.}
allowed and, additionally, a difference between two wxDateTime objects can be
taken and this will yield wxTimeSpan.}
negated giving an interval of the same magnitude but of opposite time
direction.}
\end{twocollist}
For all these operations there are corresponding global (overloaded) operators
negated giving an interval of the same magnitude but of opposite time
direction.}
\end{twocollist}
For all these operations there are corresponding global (overloaded) operators
Multiply(). Unary minus as well as composite assignment operations (like $+=$)
are only implemented as members and Neg() is the synonym for unary minus.
Multiply(). Unary minus as well as composite assignment operations (like $+=$)
are only implemented as members and Neg() is the synonym for unary minus.
To do it, you will need to call \helpref{ToTimezone}{wxdatetimetotimezone} or
\helpref{MakeTimezone}{wxdatetimemaketimezone} methods to adjust the date for
the target time zone. There are also special versions of these functions
To do it, you will need to call \helpref{ToTimezone}{wxdatetimetotimezone} or
\helpref{MakeTimezone}{wxdatetimemaketimezone} methods to adjust the date for
the target time zone. There are also special versions of these functions
-\helpref{ToGMT}{wxdatetimetogmt} and \helpref{MakeGMT}{wxdatetimemakegmt} for
-the most common case - when the date should be constructed in GMT.
+\helpref{ToUTC}{wxdatetimetoutc} and \helpref{MakeUTC}{wxdatetimemakeutc} for
+the most common case - when the date should be constructed in UTC.
methods which are affected by the time zone (all methods getting date
components and the date formatting ones, for example). In particular, the
Format() family of methods accepts a TimeZone parameter and this allows to
methods which are affected by the time zone (all methods getting date
components and the date formatting ones, for example). In particular, the
Format() family of methods accepts a TimeZone parameter and this allows to
are still included but are reimplemented in terms of wxDateTime. However, using
them is strongly discouraged because they have a few quirks/bugs and were not
`Y2K' compatible.
are still included but are reimplemented in terms of wxDateTime. However, using
them is strongly discouraged because they have a few quirks/bugs and were not
`Y2K' compatible.