1998-05-20 14:25:30 +00:00
|
|
|
\section{\class{wxDate}}\label{wxdate}
|
|
|
|
|
|
|
|
A class for manipulating dates.
|
|
|
|
|
1999-02-09 21:22:58 +00:00
|
|
|
NOTE: this class should be
|
|
|
|
used with caution, since it is not fully tested. It may be replaced
|
|
|
|
with a new class in the near future.
|
|
|
|
|
1998-05-20 14:25:30 +00:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxTime}{wxtime}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxDate::wxDate}\label{wxdateconstr}
|
|
|
|
|
|
|
|
\func{}{wxDate}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
|
|
|
\func{}{wxDate}{\param{const wxDate\&}{ date}}
|
|
|
|
|
|
|
|
Copy constructor.
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{}{wxDate}{\param{int}{ month}, \param{int}{ day}, \param{int}{ year}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Constructor taking month, day and year.
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{}{wxDate}{\param{long}{ julian}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Constructor taking an integer representing the Julian date. This is the number of days since
|
|
|
|
1st January 4713 B.C., so to convert from the number of days since 1st January 1901,
|
|
|
|
construct a date for 1/1/1901, and add the number of days.
|
|
|
|
|
|
|
|
\func{}{wxDate}{\param{const wxString\& }{dateString}}
|
|
|
|
|
|
|
|
Constructor taking a string representing a date. This must be either the string TODAY, or of the
|
|
|
|
form {\tt MM/DD/YYYY} or {\tt MM-DD-YYYY}. For example:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
wxDate date("11/26/1966");
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{date}{Date to copy.}
|
|
|
|
|
|
|
|
\docparam{month}{Month: a number between 1 and 12.}
|
|
|
|
|
|
|
|
\docparam{day}{Day: a number between 1 and 31.}
|
|
|
|
|
|
|
|
\docparam{year}{Year, such as 1995, 2005.}
|
|
|
|
|
|
|
|
\membersection{wxDate::\destruct{wxDate}}
|
|
|
|
|
|
|
|
\func{void}{\destruct{wxDate}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
|
|
|
\membersection{wxDate::AddMonths}\label{wxdateaddmonths}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{AddMonths}{\param{int}{ months=1}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Adds the given number of months to the date, returning a reference to `this'.
|
|
|
|
|
|
|
|
\membersection{wxDate::AddWeeks}\label{wxdateaddweeks}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{AddWeeks}{\param{int}{ weeks=1}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Adds the given number of weeks to the date, returning a reference to `this'.
|
|
|
|
|
|
|
|
\membersection{wxDate::AddYears}\label{wxdateaddyears}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{AddYears}{\param{int}{ years=1}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Adds the given number of months to the date, returning a reference to `this'.
|
|
|
|
|
|
|
|
\membersection{wxDate::FormatDate}\label{wxdateformatdate}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\constfunc{wxString}{FormatDate}{\param{int}{ type=-1}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Formats the date according to {\it type} if not -1, or according
|
|
|
|
to the current display type if -1.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{type}{-1 or one of:
|
|
|
|
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{wxDAY}{Format day only.}
|
|
|
|
\twocolitem{wxMONTH}{Format month only.}
|
|
|
|
\twocolitem{wxMDY}{Format MONTH, DAY, YEAR.}
|
|
|
|
\twocolitem{wxFULL}{Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.}
|
|
|
|
\twocolitem{wxEUROPEAN}{Format day, month and year in European style: DAY, MONTH, YEAR.}
|
|
|
|
\end{twocollist}}
|
|
|
|
|
|
|
|
\membersection{wxDate::GetDay}\label{wxdategetday}
|
|
|
|
|
|
|
|
\constfunc{int}{GetDay}{\void}
|
|
|
|
|
|
|
|
Returns the numeric day (in the range 1 to 31).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetDayOfWeek}\label{wxdategetdayofweek}
|
|
|
|
|
|
|
|
\constfunc{int}{GetDayOfWeek}{\void}
|
|
|
|
|
|
|
|
Returns the integer day of the week (in the range 1 to 7).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetDayOfWeekName}\label{wxdategetdayofweekname}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetDayOfWeekName}{\void}
|
|
|
|
|
|
|
|
Returns the name of the day of week.
|
|
|
|
|
|
|
|
\membersection{wxDate::GetDayOfYear}\label{wxdategetdayofyear}
|
|
|
|
|
|
|
|
\constfunc{long}{GetDayOfYear}{\void}
|
|
|
|
|
|
|
|
Returns the day of the year (from 1 to 365).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetDaysInMonth}\label{wxdategetdaysinmonth}
|
|
|
|
|
|
|
|
\constfunc{int}{GetDaysInMonth}{\void}
|
|
|
|
|
|
|
|
Returns the number of days in the month (in the range 1 to 31).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetFirstDayOfMonth}\label{wxdategetfirstdayofmonth}
|
|
|
|
|
|
|
|
\constfunc{int}{GetFirstDayOfMonth}{\void}
|
|
|
|
|
|
|
|
Returns the day of week that is first in the month (in the range 1 to 7).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetJulianDate}\label{wxdategetjuliandate}
|
|
|
|
|
|
|
|
\constfunc{long}{GetJulianDate}{\void}
|
|
|
|
|
|
|
|
Returns the Julian date.
|
|
|
|
|
|
|
|
\membersection{wxDate::GetMonth}\label{wxdategetmonth}
|
|
|
|
|
|
|
|
\constfunc{int}{GetMonth}{\void}
|
|
|
|
|
|
|
|
Returns the month number (in the range 1 to 12).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetMonthEnd}
|
|
|
|
|
|
|
|
\func{wxDate}{GetMonthEnd}{\void}
|
|
|
|
|
|
|
|
Returns the date representing the last day of the month.
|
|
|
|
|
|
|
|
\membersection{wxDate::GetMonthName}\label{wxdategetmonthname}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetMonthName}{\void}
|
|
|
|
|
|
|
|
Returns the name of the month. Do not delete the returned storage.
|
|
|
|
|
|
|
|
\membersection{wxDate::GetMonthStart}\label{wxdategetmonthstart}
|
|
|
|
|
|
|
|
\constfunc{wxDate}{GetMonthStart}{\void}
|
|
|
|
|
|
|
|
Returns the date representing the first day of the month.
|
|
|
|
|
|
|
|
\membersection{wxDate::GetWeekOfMonth}\label{wxdategetweekofmonth}
|
|
|
|
|
|
|
|
\constfunc{int}{GetWeekOfMonth}{\void}
|
|
|
|
|
|
|
|
Returns the week of month (in the range 1 to 6).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetWeekOfYear}\label{wxdategetweekofyear}
|
|
|
|
|
|
|
|
\constfunc{int}{GetWeekOfYear}{\void}
|
|
|
|
|
|
|
|
Returns the week of year (in the range 1 to 52).
|
|
|
|
|
|
|
|
\membersection{wxDate::GetYear}\label{wxdategetyear}
|
|
|
|
|
|
|
|
\constfunc{int}{GetYear}{\void}
|
|
|
|
|
|
|
|
Returns the year as an integer (such as `1995').
|
|
|
|
|
|
|
|
\membersection{wxDate::GetYearEnd}\label{wxdategetyearend}
|
|
|
|
|
|
|
|
\constfunc{wxDate}{GetYearEnd}{\void}
|
|
|
|
|
|
|
|
Returns the date representing the last day of the year.
|
|
|
|
|
|
|
|
\membersection{wxDate::GetYearStart}\label{wxdategetyearstart}
|
|
|
|
|
|
|
|
\constfunc{wxDate}{GetYearStart}{\void}
|
|
|
|
|
|
|
|
Returns the date representing the first day of the year.
|
|
|
|
|
|
|
|
\membersection{wxDate::IsLeapYear}\label{wxdateisleapyear}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsLeapYear}{\void}
|
|
|
|
|
|
|
|
Returns TRUE if the year of this date is a leap year.
|
|
|
|
|
|
|
|
\membersection{wxDate::Set}\label{wxdateset}
|
|
|
|
|
|
|
|
\func{wxDate\&}{Set}{\void}
|
|
|
|
|
|
|
|
Sets the date to current system date, returning a reference to `this'.
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{Set}{\param{long}{ julian}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Sets the date to the given Julian date, returning a reference to `this'.
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{Set}{\param{int}{ month}, \param{int}{ day}, \param{int}{ year}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Sets the date to the given date, returning a reference to `this'.
|
|
|
|
|
|
|
|
{\it month} is a number from 1 to 12.
|
|
|
|
|
|
|
|
{\it day} is a number from 1 to 31.
|
|
|
|
|
|
|
|
{\it year} is a year, such as 1995, 2005.
|
|
|
|
|
|
|
|
\membersection{wxDate::SetFormat}\label{wxdatesetformat}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{void}{SetFormat}{\param{int}{ format}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Sets the current format type.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{format}{-1 or one of:
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{{\bf wxDAY}}{Format day only.}
|
|
|
|
\twocolitem{{\bf wxMONTH}}{Format month only.}
|
|
|
|
\twocolitem{{\bf wxMDY}}{Format MONTH, DAY, YEAR.}
|
|
|
|
\twocolitem{{\bf wxFULL}}{Format day, month and year in US style: DAYOFWEEK, MONTH, DAY, YEAR.}
|
|
|
|
\twocolitem{{\bf wxEUROPEAN}}{Format day, month and year in European style: DAY, MONTH, YEAR.}
|
|
|
|
\end{twocollist}}
|
|
|
|
|
|
|
|
\membersection{wxDate::SetOption}\label{wxdatesetoption}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{int}{SetOption}{\param{int}{ option}, \param{const bool}{ enable=TRUE}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Enables or disables an option for formatting.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{option}{May be one of:
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{{\bf wxNO\_CENTURY}}{The century is not formatted.}
|
|
|
|
\twocolitem{{\bf wxDATE\_ABBR}}{Month and day names are abbreviated to 3 characters when formatting.}
|
|
|
|
\end{twocollist}}
|
|
|
|
|
|
|
|
\membersection{wxDate::operator wxString}\label{wxdatewxstring}
|
|
|
|
|
|
|
|
\func{}{operator wxString}{\void}
|
|
|
|
|
|
|
|
Conversion operator, to convert wxDate to wxString by calling FormatDate.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $+$}\label{wxdateplus}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate}{operator $+$}{\param{long}{ i}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate}{operator $+$}{\param{int}{ i}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Adds an integer number of days to the date, returning a date.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $-$}\label{wxdateminus}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate}{operator $-$}{\param{long}{ i}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate}{operator $-$}{\param{int}{ i}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Subtracts an integer number of days from the date, returning a date.
|
|
|
|
|
|
|
|
\func{long}{operator $-$}{\param{const wxDate\&}{ date}}
|
|
|
|
|
|
|
|
Subtracts one date from another, return the number of intervening days.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $+=$}\label{wxdateplusequals}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{operator $+=$}{\param{long}{ i}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Postfix operator: adds an integer number of days to the date, returning
|
|
|
|
a reference to `this' date.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $-=$}\label{wxdateminusequals}
|
|
|
|
|
1998-06-14 12:11:50 +00:00
|
|
|
\func{wxDate\&}{operator $-=$}{\param{long}{ i}}
|
1998-05-20 14:25:30 +00:00
|
|
|
|
|
|
|
Postfix operator: subtracts an integer number of days from the date, returning
|
|
|
|
a reference to `this' date.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $++$}\label{wxdateplusplus}
|
|
|
|
|
|
|
|
\func{wxDate\&}{operator $++$}{\void}
|
|
|
|
|
|
|
|
Increments the date (postfix or prefix).
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $--$}\label{wxdateminusminus}
|
|
|
|
|
|
|
|
\func{wxDate\&}{operator $--$}{\void}
|
|
|
|
|
|
|
|
Decrements the date (postfix or prefix).
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $<$}\label{wxdatelessthan}
|
|
|
|
|
|
|
|
\func{friend bool}{operator $<$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
|
|
|
|
|
|
|
Function to compare two dates, returning TRUE if {\it date1} is earlier than {\it date2}.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $<=$}\label{wxdatelessthaneq}
|
|
|
|
|
|
|
|
\func{friend bool}{operator $<=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
|
|
|
|
|
|
|
Function to compare two dates, returning TRUE if {\it date1} is earlier than or equal to {\it date2}.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $>$}\label{wxdategreaterthan}
|
|
|
|
|
|
|
|
\func{friend bool}{operator $>$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
|
|
|
|
|
|
|
Function to compare two dates, returning TRUE if {\it date1} is later than {\it date2}.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $>=$}\label{wxdategreaterthaneq}
|
|
|
|
|
|
|
|
\func{friend bool}{operator $>=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
|
|
|
|
|
|
|
Function to compare two dates, returning TRUE if {\it date1} is later than or equal to {\it date2}.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $==$}\label{wxdateequals}
|
|
|
|
|
|
|
|
\func{friend bool}{operator $==$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
|
|
|
|
|
|
|
Function to compare two dates, returning TRUE if {\it date1} is equal to {\it date2}.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator $!=$}\label{wxdatenotequals}
|
|
|
|
|
|
|
|
\func{friend bool}{operator $!=$}{\param{const wxDate\&}{ date1}, \param{const wxDate\&}{ date2}}
|
|
|
|
|
|
|
|
Function to compare two dates, returning TRUE if {\it date1} is not equal to {\it date2}.
|
|
|
|
|
|
|
|
\membersection{wxDate::operator \cinsert}\label{wxdateinsert}
|
|
|
|
|
|
|
|
\func{friend ostream\&}{operator \cinsert}{\param{ostream\&}{ os}, \param{const wxDate\&}{ date}}
|
|
|
|
|
|
|
|
Function to output a wxDate to an ostream.
|
|
|
|
|
|
|
|
|